home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1997-10-07 | 14.8 KB | [TEXT/MPS ] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
1%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Tue Oct 7 03:08:11 1997, modified Tue Oct 7 03:08:11 1997, creator 'MPS ', type ASCII, 14402 bytes "strlist.c" , at 0x38c2 428 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| dearkID
| deark: macbinary
| default
| |
100%
| lsar
| MacBinary
| default
| |
100%
| librempegprobeID
| NGC (Nintendo DSP Standard) (ngcdspstd)
| default (weak)
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MPS ] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 09 73 74 72 6c 69 73 | 74 2e 63 00 00 00 00 00 |..strlis|t.c.....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 38 42 00 | 00 01 ac b0 5f 90 5b b0 |.....8B.|...._.[.|
|00000060| 5f 90 5b 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |_.[.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 df fe 00 00 |........|........|
|00000080| 2f 2a 20 66 69 6c 65 20 | 73 74 72 6c 69 73 74 2e |/* file |strlist.|
|00000090| 63 20 43 6f 70 79 72 69 | 67 68 74 20 28 43 29 20 |c Copyri|ght (C) |
|000000a0| 31 39 39 35 2c 20 31 39 | 39 36 2c 20 31 39 39 37 |1995, 19|96, 1997|
|000000b0| 20 62 79 20 4a 6f 68 6e | 20 4d 6f 6e 74 62 72 69 | by John| Montbri|
|000000c0| 61 6e 64 2e 20 20 41 6c | 6c 20 52 69 67 68 74 73 |and. Al|l Rights|
|000000d0| 20 52 65 73 65 72 76 65 | 64 2e 20 2a 2f 0d 0d 2f | Reserve|d. */../|
|000000e0| 2a 20 46 69 6c 65 20 73 | 74 72 6c 69 73 74 2e 63 |* File s|trlist.c|
|000000f0| 0d 20 20 20 20 47 65 6e | 65 72 61 6c 20 53 74 72 |. Gen|eral Str|
|00000100| 69 6e 67 20 4c 69 73 74 | 20 28 53 54 52 23 29 20 |ing List| (STR#) |
|00000110| 65 64 69 74 69 6e 67 20 | 72 6f 75 74 69 6e 65 73 |editing |routines|
|00000120| 2c 20 69 6d 70 6c 65 6d | 65 6e 74 61 74 69 6f 6e |, implem|entation|
|00000130| 2e 0d 20 20 20 20 43 6f | 70 79 72 69 67 68 74 20 |.. Co|pyright |
|00000140| 28 43 29 20 31 39 39 35 | 2c 20 31 39 39 36 2c 20 |(C) 1995|, 1996, |
|00000150| 31 39 39 37 20 62 79 20 | 4a 6f 68 6e 20 4d 6f 6e |1997 by |John Mon|
|00000160| 74 62 72 69 61 6e 64 2e | 20 20 41 6c 6c 20 52 69 |tbriand.| All Ri|
|00000170| 67 68 74 73 20 52 65 73 | 65 72 76 65 64 2e 0d 09 |ghts Res|erved...|
|00000180| 50 65 72 6d 69 73 73 69 | 6f 6e 20 67 72 61 6e 74 |Permissi|on grant|
|00000190| 65 64 20 66 6f 72 20 70 | 75 62 6c 69 63 20 75 73 |ed for p|ublic us|
|000001a0| 65 2e 0d 09 44 69 73 74 | 72 69 62 75 74 65 20 66 |e...Dist|ribute f|
|000001b0| 72 65 65 6c 79 20 69 6e | 20 61 72 65 61 73 20 77 |reely in| areas w|
|000001c0| 68 65 72 65 20 74 68 65 | 20 6c 61 77 73 20 6f 66 |here the| laws of|
|000001d0| 20 63 6f 70 79 72 69 67 | 68 74 20 61 70 70 6c 79 | copyrig|ht apply|
|000001e0| 2e 0d 09 55 53 45 20 41 | 54 20 59 4f 55 52 20 4f |...USE A|T YOUR O|
|000001f0| 57 4e 20 52 49 53 4b 2e | 0d 09 44 4f 20 4e 4f 54 |WN RISK.|..DO NOT|
|00000200| 20 44 49 53 54 52 49 42 | 55 54 45 20 4d 4f 44 49 | DISTRIB|UTE MODI|
|00000210| 46 49 45 44 20 43 4f 50 | 49 45 53 2e 0d 09 43 6f |FIED COP|IES...Co|
|00000220| 6d 6d 65 6e 74 73 2f 71 | 75 65 73 74 69 6f 6e 73 |mments/q|uestions|
|00000230| 2f 70 6f 73 74 63 61 72 | 64 73 20 74 6f 20 74 68 |/postcar|ds to th|
|00000240| 65 20 61 75 74 68 6f 72 | 20 61 74 20 74 68 65 20 |e author| at the |
|00000250| 61 64 64 72 65 73 73 3a | 0d 09 09 4a 6f 68 6e 20 |address:|...John |
|00000260| 4d 6f 6e 74 62 72 69 61 | 6e 64 0d 09 09 50 2e 4f |Montbria|nd...P.O|
|00000270| 2e 20 42 6f 78 2e 20 31 | 31 33 33 0d 09 09 53 61 |. Box. 1|133...Sa|
|00000280| 73 6b 61 74 6f 6f 6e 20 | 53 61 73 6b 61 74 63 68 |skatoon |Saskatch|
|00000290| 65 77 61 6e 20 43 61 6e | 61 64 61 0d 09 09 53 37 |ewan Can|ada...S7|
|000002a0| 4b 20 33 4e 32 0d 09 6f | 72 20 62 79 20 65 6d 61 |K 3N2..o|r by ema|
|000002b0| 69 6c 20 61 74 3a 0d 09 | 09 74 69 6e 79 6a 6f 68 |il at:..|.tinyjoh|
|000002c0| 6e 40 73 6b 2e 73 79 6d | 70 61 74 69 63 6f 2e 63 |n@sk.sym|patico.c|
|000002d0| 61 0d 09 49 66 20 79 6f | 75 20 77 6f 75 6c 64 20 |a..If yo|u would |
|000002e0| 6c 69 6b 65 20 74 6f 20 | 68 61 76 65 3a 0d 09 09 |like to |have:...|
|000002f0| 74 65 63 68 6e 69 63 61 | 6c 20 73 75 70 70 6f 72 |technica|l suppor|
|00000300| 74 20 72 65 67 61 72 64 | 69 6e 67 20 74 68 69 73 |t regard|ing this|
|00000310| 20 66 69 6c 65 2c 20 73 | 65 6e 64 20 61 20 70 6f | file, s|end a po|
|00000320| 73 74 63 61 72 64 2e 0d | 09 73 65 65 20 61 6c 73 |stcard..|.see als|
|00000330| 6f 3a 0d 09 09 68 74 74 | 70 3a 2f 2f 77 77 77 33 |o:...htt|p://www3|
|00000340| 2e 73 6b 2e 73 79 6d 70 | 61 74 69 63 6f 2e 63 61 |.sk.symp|atico.ca|
|00000350| 2f 74 69 6e 79 6a 6f 68 | 6e 0d 2a 2f 0d 0d 23 69 |/tinyjoh|n.*/..#i|
|00000360| 6e 63 6c 75 64 65 20 22 | 73 74 72 6c 69 73 74 2e |nclude "|strlist.|
|00000370| 68 22 0d 23 69 6e 63 6c | 75 64 65 20 3c 4d 65 6d |h".#incl|ude <Mem|
|00000380| 6f 72 79 2e 68 3e 0d 23 | 69 6e 63 6c 75 64 65 20 |ory.h>.#|include |
|00000390| 3c 53 74 64 4c 69 62 2e | 68 3e 0d 23 69 6e 63 6c |<StdLib.|h>.#incl|
|000003a0| 75 64 65 20 3c 4f 53 55 | 74 69 6c 73 2e 68 3e 0d |ude <OSU|tils.h>.|
|000003b0| 23 69 6e 63 6c 75 64 65 | 20 3c 54 6f 6f 6c 55 74 |#include| <ToolUt|
|000003c0| 69 6c 73 2e 68 3e 0d 23 | 69 6e 63 6c 75 64 65 20 |ils.h>.#|include |
|000003d0| 3c 53 74 72 69 6e 67 2e | 68 3e 0d 23 69 6e 63 6c |<String.|h>.#incl|
|000003e0| 75 64 65 20 3c 53 74 72 | 69 6e 67 73 2e 68 3e 0d |ude <Str|ings.h>.|
|000003f0| 23 69 6e 63 6c 75 64 65 | 20 3c 52 65 73 6f 75 72 |#include| <Resour|
|00000400| 63 65 73 2e 68 3e 0d 23 | 69 6e 63 6c 75 64 65 20 |ces.h>.#|include |
|00000410| 3c 53 63 72 69 70 74 2e | 68 3e 0d 23 69 6e 63 6c |<Script.|h>.#incl|
|00000420| 75 64 65 20 3c 54 65 78 | 74 55 74 69 6c 73 2e 68 |ude <Tex|tUtils.h|
|00000430| 3e 0d 23 69 6e 63 6c 75 | 64 65 20 3c 53 74 64 41 |>.#inclu|de <StdA|
|00000440| 72 67 2e 68 3e 0d 23 69 | 6e 63 6c 75 64 65 20 3c |rg.h>.#i|nclude <|
|00000450| 45 72 72 6f 72 73 2e 68 | 3e 0d 0d 48 61 6e 64 6c |Errors.h|>..Handl|
|00000460| 65 20 4e 65 77 53 74 72 | 69 6e 67 4c 69 73 74 28 |e NewStr|ingList(|
|00000470| 76 6f 69 64 29 20 7b 0d | 20 20 20 20 72 65 74 75 |void) {.| retu|
|00000480| 72 6e 20 4e 65 77 48 61 | 6e 64 6c 65 43 6c 65 61 |rn NewHa|ndleClea|
|00000490| 72 28 73 69 7a 65 6f 66 | 28 73 68 6f 72 74 29 29 |r(sizeof|(short))|
|000004a0| 3b 0d 7d 0d 0d 48 61 6e | 64 6c 65 20 4d 61 6b 65 |;.}..Han|dle Make|
|000004b0| 53 74 72 69 6e 67 4c 69 | 73 74 28 6c 6f 6e 67 20 |StringLi|st(long |
|000004c0| 6e 2c 20 2e 2e 2e 29 20 | 7b 0d 20 20 20 20 76 61 |n, ...) |{. va|
|000004d0| 5f 6c 69 73 74 20 61 72 | 67 73 3b 0d 20 20 20 20 |_list ar|gs;. |
|000004e0| 6c 6f 6e 67 20 69 3b 0d | 20 20 20 20 63 68 61 72 |long i;.| char|
|000004f0| 20 2a 73 3b 0d 20 20 20 | 20 53 74 72 32 35 35 20 | *s;. | Str255 |
|00000500| 74 65 6d 70 73 74 72 3b | 0d 20 20 20 20 48 61 6e |tempstr;|. Han|
|00000510| 64 6c 65 20 6c 69 73 74 | 3b 0d 20 20 20 20 69 66 |dle list|;. if|
|00000520| 20 28 28 6c 69 73 74 20 | 3d 20 4e 65 77 53 74 72 | ((list |= NewStr|
|00000530| 69 6e 67 4c 69 73 74 28 | 29 29 20 21 3d 20 4e 55 |ingList(|)) != NU|
|00000540| 4c 4c 29 20 7b 0d 20 20 | 20 20 20 20 20 20 76 61 |LL) {. | va|
|00000550| 5f 73 74 61 72 74 28 61 | 72 67 73 2c 20 6e 29 3b |_start(a|rgs, n);|
|00000560| 0d 20 20 20 20 20 20 20 | 20 66 6f 72 20 28 69 3d |. | for (i=|
|00000570| 30 3b 20 69 3c 6e 3b 20 | 69 2b 2b 29 20 7b 0d 20 |0; i<n; |i++) {. |
|00000580| 20 20 20 20 20 20 20 20 | 20 20 20 73 20 3d 20 76 | | s = v|
|00000590| 61 5f 61 72 67 28 61 72 | 67 73 2c 20 63 68 61 72 |a_arg(ar|gs, char|
|000005a0| 2a 29 3b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |*);. | |
|000005b0| 53 74 72 69 6e 67 4c 69 | 73 74 41 70 70 65 6e 64 |StringLi|stAppend|
|000005c0| 28 6c 69 73 74 2c 20 63 | 32 70 73 74 72 28 73 74 |(list, c|2pstr(st|
|000005d0| 72 63 70 79 28 28 63 68 | 61 72 2a 29 20 74 65 6d |rcpy((ch|ar*) tem|
|000005e0| 70 73 74 72 2c 20 73 29 | 29 29 3b 0d 20 20 20 20 |pstr, s)|));. |
|000005f0| 20 20 20 20 7d 0d 20 20 | 20 20 20 20 20 20 76 61 | }. | va|
|00000600| 5f 65 6e 64 28 61 72 67 | 73 29 3b 0d 20 20 20 20 |_end(arg|s);. |
|00000610| 7d 0d 20 20 20 20 72 65 | 74 75 72 6e 20 6c 69 73 |}. re|turn lis|
|00000620| 74 3b 0d 7d 0d 0d 48 61 | 6e 64 6c 65 20 47 65 74 |t;.}..Ha|ndle Get|
|00000630| 53 74 72 69 6e 67 4c 69 | 73 74 28 73 68 6f 72 74 |StringLi|st(short|
|00000640| 20 69 64 29 20 7b 0d 20 | 20 20 20 72 65 74 75 72 | id) {. | retur|
|00000650| 6e 20 47 65 74 52 65 73 | 6f 75 72 63 65 28 27 53 |n GetRes|ource('S|
|00000660| 54 52 23 27 2c 20 69 64 | 29 3b 0d 7d 0d 0d 48 61 |TR#', id|);.}..Ha|
|00000670| 6e 64 6c 65 20 47 65 74 | 31 53 74 72 69 6e 67 4c |ndle Get|1StringL|
|00000680| 69 73 74 28 73 68 6f 72 | 74 20 69 64 29 20 7b 0d |ist(shor|t id) {.|
|00000690| 20 20 20 20 72 65 74 75 | 72 6e 20 47 65 74 31 52 | retu|rn Get1R|
|000006a0| 65 73 6f 75 72 63 65 28 | 27 53 54 52 23 27 2c 20 |esource(|'STR#', |
|000006b0| 69 64 29 3b 0d 7d 0d 0d | 73 68 6f 72 74 20 53 74 |id);.}..|short St|
|000006c0| 72 69 6e 67 4c 69 73 74 | 53 69 7a 65 28 48 61 6e |ringList|Size(Han|
|000006d0| 64 6c 65 20 6c 69 73 74 | 29 20 7b 0d 20 20 20 20 |dle list|) {. |
|000006e0| 69 66 20 28 6c 69 73 74 | 20 3d 3d 20 4e 55 4c 4c |if (list| == NULL|
|000006f0| 29 0d 20 20 20 20 20 20 | 20 20 72 65 74 75 72 6e |). | return|
|00000700| 20 30 3b 0d 20 20 20 20 | 65 6c 73 65 20 72 65 74 | 0;. |else ret|
|00000710| 75 72 6e 20 2a 2a 20 28 | 28 73 68 6f 72 74 2a 2a |urn ** (|(short**|
|00000720| 29 20 6c 69 73 74 29 3b | 0d 7d 0d 0d 76 6f 69 64 |) list);|.}..void|
|00000730| 20 44 69 73 70 6f 73 65 | 53 74 72 69 6e 67 4c 69 | Dispose|StringLi|
|00000740| 73 74 28 48 61 6e 64 6c | 65 20 6c 69 73 74 29 20 |st(Handl|e list) |
|00000750| 7b 0d 20 20 20 20 63 68 | 61 72 20 66 6c 61 67 73 |{. ch|ar flags|
|00000760| 3b 0d 20 20 20 20 69 66 | 20 28 6c 69 73 74 20 21 |;. if| (list !|
|00000770| 3d 20 4e 55 4c 4c 29 20 | 7b 0d 20 20 20 20 20 20 |= NULL) |{. |
|00000780| 20 20 66 6c 61 67 73 20 | 3d 20 48 47 65 74 53 74 | flags |= HGetSt|
|00000790| 61 74 65 28 6c 69 73 74 | 29 3b 0d 20 20 20 20 20 |ate(list|);. |
|000007a0| 20 20 20 69 66 20 28 28 | 66 6c 61 67 73 20 26 20 | if ((|flags & |
|000007b0| 28 31 3c 3c 35 29 29 20 | 21 3d 20 30 29 20 7b 0d |(1<<5)) |!= 0) {.|
|000007c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 52 65 6c 65 | | Rele|
|000007d0| 61 73 65 52 65 73 6f 75 | 72 63 65 28 6c 69 73 74 |aseResou|rce(list|
|000007e0| 29 3b 0d 20 20 20 20 20 | 20 20 20 7d 20 65 6c 73 |);. | } els|
|000007f0| 65 20 7b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |e {. | |
|00000800| 44 69 73 70 6f 73 65 48 | 61 6e 64 6c 65 28 6c 69 |DisposeH|andle(li|
|00000810| 73 74 29 3b 0d 20 20 20 | 20 20 20 20 20 7d 0d 20 |st);. | }. |
|00000820| 20 20 20 7d 0d 7d 0d 0d | 4f 53 45 72 72 20 53 61 | }.}..|OSErr Sa|
|00000830| 76 65 53 74 72 69 6e 67 | 4c 69 73 74 28 48 61 6e |veString|List(Han|
|00000840| 64 6c 65 20 6c 69 73 74 | 29 20 7b 0d 20 20 20 20 |dle list|) {. |
|00000850| 73 68 6f 72 74 20 72 73 | 72 63 2c 20 73 61 76 65 |short rs|rc, save|
|00000860| 72 73 72 63 3b 0d 20 20 | 20 20 63 68 61 72 20 66 |rsrc;. | char f|
|00000870| 6c 61 67 73 3b 0d 20 20 | 20 20 4f 53 45 72 72 20 |lags;. | OSErr |
|00000880| 65 72 72 3b 0d 20 20 20 | 20 66 6c 61 67 73 20 3d |err;. | flags =|
|00000890| 20 48 47 65 74 53 74 61 | 74 65 28 6c 69 73 74 29 | HGetSta|te(list)|
|000008a0| 3b 0d 20 20 20 20 69 66 | 20 28 28 65 72 72 20 3d |;. if| ((err =|
|000008b0| 20 4d 65 6d 45 72 72 6f | 72 28 29 29 20 21 3d 20 | MemErro|r()) != |
|000008c0| 6e 6f 45 72 72 29 20 72 | 65 74 75 72 6e 20 65 72 |noErr) r|eturn er|
|000008d0| 72 3b 0d 20 20 20 20 69 | 66 20 28 28 66 6c 61 67 |r;. i|f ((flag|
|000008e0| 73 20 26 20 28 31 3c 3c | 35 29 29 20 3d 3d 20 30 |s & (1<<|5)) == 0|
|000008f0| 29 20 72 65 74 75 72 6e | 20 70 61 72 61 6d 45 72 |) return| paramEr|
|00000900| 72 3b 20 2f 2a 20 69 73 | 20 69 74 20 61 20 72 65 |r; /* is| it a re|
|00000910| 73 6f 75 72 63 65 3f 20 | 20 2a 2f 0d 20 20 20 20 |source? | */. |
|00000920| 73 61 76 65 72 73 72 63 | 20 3d 20 43 75 72 52 65 |saversrc| = CurRe|
|00000930| 73 46 69 6c 65 28 29 3b | 0d 20 20 20 20 72 73 72 |sFile();|. rsr|
|00000940| 63 20 3d 20 48 6f 6d 65 | 52 65 73 46 69 6c 65 28 |c = Home|ResFile(|
|00000950| 6c 69 73 74 29 3b 0d 20 | 20 20 20 69 66 20 28 73 |list);. | if (s|
|00000960| 61 76 65 72 73 72 63 20 | 21 3d 20 72 73 72 63 29 |aversrc |!= rsrc)|
|00000970| 0d 20 20 20 20 20 20 20 | 20 55 73 65 52 65 73 46 |. | UseResF|
|00000980| 69 6c 65 28 72 73 72 63 | 29 3b 0d 20 20 20 20 43 |ile(rsrc|);. C|
|00000990| 68 61 6e 67 65 64 52 65 | 73 6f 75 72 63 65 28 6c |hangedRe|source(l|
|000009a0| 69 73 74 29 3b 0d 20 20 | 20 20 55 70 64 61 74 65 |ist);. | Update|
|000009b0| 52 65 73 46 69 6c 65 28 | 72 73 72 63 29 3b 0d 20 |ResFile(|rsrc);. |
|000009c0| 20 20 20 65 72 72 20 3d | 20 52 65 73 45 72 72 6f | err =| ResErro|
|000009d0| 72 28 29 3b 0d 20 20 20 | 20 69 66 20 28 73 61 76 |r();. | if (sav|
|000009e0| 65 72 73 72 63 20 21 3d | 20 72 73 72 63 29 0d 20 |ersrc !=| rsrc). |
|000009f0| 20 20 20 20 20 20 20 55 | 73 65 52 65 73 46 69 6c | U|seResFil|
|00000a00| 65 28 73 61 76 65 72 73 | 72 63 29 3b 0d 20 20 20 |e(savers|rc);. |
|00000a10| 20 72 65 74 75 72 6e 20 | 65 72 72 3b 0d 7d 0d 0d | return |err;.}..|
|00000a20| 0d 2f 2a 20 53 74 72 69 | 6e 67 4c 69 73 74 45 6c |./* Stri|ngListEl|
|00000a30| 74 20 72 65 74 75 72 6e | 73 20 61 20 70 6f 69 6e |t return|s a poin|
|00000a40| 74 65 72 20 74 6f 20 61 | 20 73 74 72 69 6e 67 20 |ter to a| string |
|00000a50| 69 6e 20 61 20 73 74 72 | 69 6e 67 20 6c 69 73 74 |in a str|ing list|
|00000a60| 2e 0d 20 20 20 20 53 74 | 72 69 6e 67 4c 69 73 74 |.. St|ringList|
|00000a70| 45 6c 74 20 72 65 74 75 | 72 6e 73 20 61 20 70 6f |Elt retu|rns a po|
|00000a80| 69 6e 74 65 72 20 74 6f | 20 74 68 65 20 73 74 72 |inter to| the str|
|00000a90| 69 6e 67 20 64 61 74 61 | 20 63 6f 6e 74 61 69 6e |ing data| contain|
|00000aa0| 65 64 0d 20 20 20 20 69 | 6e 20 74 68 65 20 73 74 |ed. i|n the st|
|00000ab0| 72 69 6e 67 20 6c 69 73 | 74 20 68 61 6e 64 6c 65 |ring lis|t handle|
|00000ac0| 20 73 6f 20 62 65 20 73 | 75 72 65 20 74 6f 20 6c | so be s|ure to l|
|00000ad0| 6f 63 6b 20 74 68 65 20 | 73 74 72 69 6e 67 20 6c |ock the |string l|
|00000ae0| 69 73 74 0d 20 20 20 20 | 68 61 6e 64 6c 65 20 62 |ist. |handle b|
|00000af0| 65 66 6f 72 65 20 63 61 | 6c 6c 69 6e 67 20 74 68 |efore ca|lling th|
|00000b00| 69 73 20 66 75 6e 63 74 | 69 6f 6e 2e 20 54 68 65 |is funct|ion. The|
|00000b10| 20 70 6f 69 6e 74 65 72 | 20 72 65 74 75 72 6e 65 | pointer| returne|
|00000b20| 64 20 77 69 6c 6c 0d 20 | 20 20 20 6f 6e 6c 79 20 |d will. | only |
|00000b30| 72 65 6d 61 69 6e 20 76 | 61 6c 69 64 20 75 6e 74 |remain v|alid unt|
|00000b40| 69 6c 20 74 68 65 20 6e | 65 78 74 20 74 69 6d 65 |il the n|ext time|
|00000b50| 20 74 68 65 20 68 61 6e | 64 6c 65 20 69 73 20 75 | the han|dle is u|
|00000b60| 6e 6c 6f 63 6b 65 64 2e | 20 2a 2f 0d 73 74 61 74 |nlocked.| */.stat|
|00000b70| 69 63 20 53 74 72 69 6e | 67 50 74 72 20 53 74 72 |ic Strin|gPtr Str|
|00000b80| 69 6e 67 4c 69 73 74 45 | 6c 74 28 48 61 6e 64 6c |ingListE|lt(Handl|
|00000b90| 65 20 6c 69 73 74 2c 20 | 73 68 6f 72 74 20 65 6c |e list, |short el|
|00000ba0| 74 29 20 7b 0d 20 20 20 | 20 75 6e 73 69 67 6e 65 |t) {. | unsigne|
|00000bb0| 64 20 63 68 61 72 20 2a | 73 70 3b 0d 20 20 20 20 |d char *|sp;. |
|00000bc0| 73 68 6f 72 74 20 69 2c | 20 6e 20 3b 0d 20 20 20 |short i,| n ;. |
|00000bd0| 20 69 66 20 28 6c 69 73 | 74 20 3d 3d 20 4e 55 4c | if (lis|t == NUL|
|00000be0| 4c 29 20 72 65 74 75 72 | 6e 20 4e 55 4c 4c 3b 0d |L) retur|n NULL;.|
|00000bf0| 20 20 20 20 73 70 20 3d | 20 28 75 6e 73 69 67 6e | sp =| (unsign|
|00000c00| 65 64 20 63 68 61 72 2a | 29 20 28 2a 6c 69 73 74 |ed char*|) (*list|
|00000c10| 29 3b 0d 20 20 20 20 6e | 20 3d 20 2a 2a 20 28 28 |);. n| = ** ((|
|00000c20| 73 68 6f 72 74 2a 2a 29 | 20 6c 69 73 74 29 3b 0d |short**)| list);.|
|00000c30| 20 20 20 20 69 66 20 28 | 28 65 6c 74 20 3c 20 31 | if (|(elt < 1|
|00000c40| 29 20 7c 7c 20 28 65 6c | 74 20 3e 20 6e 29 29 20 |) || (el|t > n)) |
|00000c50| 72 65 74 75 72 6e 20 4e | 55 4c 4c 3b 0d 20 20 20 |return N|ULL;. |
|00000c60| 20 66 6f 72 20 28 73 70 | 2b 3d 32 2c 20 69 3d 31 | for (sp|+=2, i=1|
|00000c70| 3b 20 69 3c 3d 6e 3b 20 | 69 2b 2b 2c 20 73 70 20 |; i<=n; |i++, sp |
|00000c80| 2b 3d 20 2a 73 70 20 2b | 20 31 29 0d 20 20 20 20 |+= *sp +| 1). |
|00000c90| 20 20 20 20 69 66 20 28 | 69 3d 3d 65 6c 74 29 20 | if (|i==elt) |
|00000ca0| 72 65 74 75 72 6e 20 73 | 70 3b 0d 20 20 20 20 72 |return s|p;. r|
|00000cb0| 65 74 75 72 6e 20 4e 55 | 4c 4c 3b 0d 7d 0d 0d 53 |eturn NU|LL;.}..S|
|00000cc0| 74 72 69 6e 67 50 74 72 | 20 52 65 74 72 69 65 76 |tringPtr| Retriev|
|00000cd0| 65 49 6e 64 53 74 72 69 | 6e 67 28 48 61 6e 64 6c |eIndStri|ng(Handl|
|00000ce0| 65 20 6c 69 73 74 2c 20 | 73 68 6f 72 74 20 65 6c |e list, |short el|
|00000cf0| 74 2c 20 53 74 72 69 6e | 67 50 74 72 20 74 68 65 |t, Strin|gPtr the|
|00000d00| 5f 73 74 72 69 6e 67 29 | 20 7b 0d 20 20 20 20 75 |_string)| {. u|
|00000d10| 6e 73 69 67 6e 65 64 20 | 63 68 61 72 20 2a 61 2c |nsigned |char *a,|
|00000d20| 20 2a 62 3b 0d 20 20 20 | 20 6c 6f 6e 67 20 6a 2c | *b;. | long j,|
|00000d30| 20 6e 3b 0d 20 20 20 20 | 53 74 72 69 6e 67 50 74 | n;. |StringPt|
|00000d40| 72 20 65 6c 74 5f 73 74 | 72 69 6e 67 3b 0d 20 20 |r elt_st|ring;. |
|00000d50| 20 20 65 6c 74 5f 73 74 | 72 69 6e 67 20 3d 20 53 | elt_st|ring = S|
|00000d60| 74 72 69 6e 67 4c 69 73 | 74 45 6c 74 28 6c 69 73 |tringLis|tElt(lis|
|00000d70| 74 2c 20 65 6c 74 29 3b | 0d 20 20 20 20 69 66 20 |t, elt);|. if |
|00000d80| 28 65 6c 74 5f 73 74 72 | 69 6e 67 20 3d 3d 20 4e |(elt_str|ing == N|
|00000d90| 55 4c 4c 29 20 72 65 74 | 75 72 6e 20 4e 55 4c 4c |ULL) ret|urn NULL|
|00000da0| 3b 0d 20 20 20 20 61 20 | 3d 20 65 6c 74 5f 73 74 |;. a |= elt_st|
|00000db0| 72 69 6e 67 3b 0d 20 20 | 20 20 62 20 3d 20 74 68 |ring;. | b = th|
|00000dc0| 65 5f 73 74 72 69 6e 67 | 3b 0d 20 20 20 20 66 6f |e_string|;. fo|
|00000dd0| 72 20 28 6a 20 3d 20 31 | 2c 20 6e 20 3d 20 28 2a |r (j = 1|, n = (*|
|00000de0| 62 2b 2b 20 3d 20 2a 61 | 2b 2b 29 3b 20 6a 20 3c |b++ = *a|++); j <|
|00000df0| 3d 20 6e 3b 20 6a 2b 2b | 29 20 2a 62 2b 2b 20 3d |= n; j++|) *b++ =|
|00000e00| 20 2a 61 2b 2b 3b 0d 20 | 20 20 20 72 65 74 75 72 | *a++;. | retur|
|00000e10| 6e 20 74 68 65 5f 73 74 | 72 69 6e 67 3b 0d 7d 0d |n the_st|ring;.}.|
|00000e20| 0d 4f 53 45 72 72 20 43 | 68 61 6e 67 65 49 6e 64 |.OSErr C|hangeInd|
|00000e30| 53 74 72 69 6e 67 28 48 | 61 6e 64 6c 65 20 6c 69 |String(H|andle li|
|00000e40| 73 74 2c 20 73 68 6f 72 | 74 20 65 6c 74 2c 20 53 |st, shor|t elt, S|
|00000e50| 74 72 69 6e 67 50 74 72 | 20 6e 65 77 5f 73 74 72 |tringPtr| new_str|
|00000e60| 69 6e 67 29 20 7b 0d 20 | 20 20 20 75 6e 73 69 67 |ing) {. | unsig|
|00000e70| 6e 65 64 20 63 68 61 72 | 20 2a 73 70 2c 20 2a 73 |ned char| *sp, *s|
|00000e80| 74 61 72 74 3b 0d 20 20 | 20 20 73 68 6f 72 74 20 |tart;. | short |
|00000e90| 69 2c 20 6e 20 3b 0d 20 | 20 20 20 69 66 20 28 6c |i, n ;. | if (l|
|00000ea0| 69 73 74 20 3d 3d 20 4e | 55 4c 4c 29 20 72 65 74 |ist == N|ULL) ret|
|00000eb0| 75 72 6e 20 70 61 72 61 | 6d 45 72 72 3b 0d 20 20 |urn para|mErr;. |
|00000ec0| 20 20 73 74 61 72 74 20 | 3d 20 73 70 20 3d 20 28 | start |= sp = (|
|00000ed0| 75 6e 73 69 67 6e 65 64 | 20 63 68 61 72 2a 29 20 |unsigned| char*) |
|00000ee0| 28 2a 6c 69 73 74 29 3b | 0d 20 20 20 20 6e 20 3d |(*list);|. n =|
|00000ef0| 20 2a 2a 20 28 28 73 68 | 6f 72 74 2a 2a 29 20 6c | ** ((sh|ort**) l|
|00000f00| 69 73 74 29 3b 0d 20 20 | 20 20 69 66 20 28 28 65 |ist);. | if ((e|
|00000f10| 6c 74 20 3c 20 31 29 20 | 7c 7c 20 28 65 6c 74 20 |lt < 1) ||| (elt |
|00000f20| 3e 20 6e 29 29 20 72 65 | 74 75 72 6e 20 70 61 72 |> n)) re|turn par|
|00000f30| 61 6d 45 72 72 3b 0d 20 | 20 20 20 66 6f 72 20 28 |amErr;. | for (|
|00000f40| 73 70 2b 3d 32 2c 20 69 | 3d 31 3b 20 69 3c 3d 6e |sp+=2, i|=1; i<=n|
|00000f50| 3b 20 69 2b 2b 2c 20 73 | 70 20 2b 3d 20 2a 73 70 |; i++, s|p += *sp|
|00000f60| 20 2b 20 31 29 0d 20 20 | 20 20 20 20 20 20 69 66 | + 1). | if|
|00000f70| 20 28 69 3d 3d 65 6c 74 | 29 20 7b 0d 20 20 20 20 | (i==elt|) {. |
|00000f80| 20 20 20 20 20 20 20 20 | 4d 75 6e 67 65 72 28 6c | |Munger(l|
|00000f90| 69 73 74 2c 20 73 70 20 | 2d 20 73 74 61 72 74 2c |ist, sp |- start,|
|00000fa0| 20 4e 55 4c 4c 2c 20 73 | 70 5b 30 5d 20 2b 20 31 | NULL, s|p[0] + 1|
|00000fb0| 2c 20 6e 65 77 5f 73 74 | 72 69 6e 67 2c 20 6e 65 |, new_st|ring, ne|
|00000fc0| 77 5f 73 74 72 69 6e 67 | 5b 30 5d 2b 31 29 3b 0d |w_string|[0]+1);.|
|00000fd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 72 65 74 75 | | retu|
|00000fe0| 72 6e 20 4d 65 6d 45 72 | 72 6f 72 28 29 3b 0d 20 |rn MemEr|ror();. |
|00000ff0| 20 20 20 20 20 20 20 7d | 0d 20 20 20 20 72 65 74 | }|. ret|
|00001000| 75 72 6e 20 70 61 72 61 | 6d 45 72 72 3b 0d 7d 0d |urn para|mErr;.}.|
|00001010| 0d 4f 53 45 72 72 20 53 | 74 72 69 6e 67 4c 69 73 |.OSErr S|tringLis|
|00001020| 74 52 65 6d 6f 76 65 28 | 48 61 6e 64 6c 65 20 6c |tRemove(|Handle l|
|00001030| 69 73 74 2c 20 73 68 6f | 72 74 20 65 6c 74 29 20 |ist, sho|rt elt) |
|00001040| 7b 0d 20 20 20 20 75 6e | 73 69 67 6e 65 64 20 63 |{. un|signed c|
|00001050| 68 61 72 20 2a 73 70 2c | 20 2a 73 74 61 72 74 3b |har *sp,| *start;|
|00001060| 0d 20 20 20 20 73 68 6f | 72 74 20 69 2c 20 6e 3b |. sho|rt i, n;|
|00001070| 0d 20 20 20 20 69 66 20 | 28 6c 69 73 74 20 3d 3d |. if |(list ==|
|00001080| 20 4e 55 4c 4c 29 20 72 | 65 74 75 72 6e 20 70 61 | NULL) r|eturn pa|
|00001090| 72 61 6d 45 72 72 3b 0d | 20 20 20 20 6e 20 3d 20 |ramErr;.| n = |
|000010a0| 2a 2a 20 28 28 73 68 6f | 72 74 2a 2a 29 20 6c 69 |** ((sho|rt**) li|
|000010b0| 73 74 29 3b 0d 20 20 20 | 20 69 66 20 28 28 65 6c |st);. | if ((el|
|000010c0| 74 20 3c 20 31 29 20 7c | 7c 20 28 65 6c 74 20 3e |t < 1) ||| (elt >|
|000010d0| 20 6e 29 29 20 72 65 74 | 75 72 6e 20 70 61 72 61 | n)) ret|urn para|
|000010e0| 6d 45 72 72 3b 0d 20 20 | 20 20 73 70 20 3d 20 73 |mErr;. | sp = s|
|000010f0| 74 61 72 74 20 3d 20 28 | 75 6e 73 69 67 6e 65 64 |tart = (|unsigned|
|00001100| 20 63 68 61 72 2a 29 20 | 28 2a 6c 69 73 74 29 3b | char*) |(*list);|
|00001110| 0d 20 20 20 20 66 6f 72 | 20 28 73 70 2b 3d 32 2c |. for| (sp+=2,|
|00001120| 20 69 3d 31 3b 20 69 3c | 3d 6e 3b 20 69 2b 2b 2c | i=1; i<|=n; i++,|
|00001130| 20 73 70 20 2b 3d 20 2a | 73 70 20 2b 20 31 29 0d | sp += *|sp + 1).|
|00001140| 20 20 20 20 20 20 20 20 | 69 66 20 28 69 3d 3d 65 | |if (i==e|
|00001150| 6c 74 29 20 7b 0d 20 20 | 20 20 20 20 20 20 20 20 |lt) {. | |
|00001160| 20 20 4d 75 6e 67 65 72 | 28 6c 69 73 74 2c 20 73 | Munger|(list, s|
|00001170| 70 2d 73 74 61 72 74 2c | 20 4e 55 4c 4c 2c 20 2a |p-start,| NULL, *|
|00001180| 73 70 20 2b 20 31 2c 20 | 26 69 2c 20 30 29 3b 0d |sp + 1, |&i, 0);.|
|00001190| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000011a0| 28 2a 2a 20 28 28 73 68 | 6f 72 74 2a 2a 29 20 6c |(** ((sh|ort**) l|
|000011b0| 69 73 74 29 29 20 2d 3d | 20 31 3b 0d 20 20 20 20 |ist)) -=| 1;. |
|000011c0| 20 20 20 20 20 20 20 20 | 72 65 74 75 72 6e 20 4d | |return M|
|000011d0| 65 6d 45 72 72 6f 72 28 | 29 3b 0d 20 20 20 20 20 |emError(|);. |
|000011e0| 20 20 20 7d 0d 20 20 20 | 20 72 65 74 75 72 6e 20 | }. | return |
|000011f0| 70 61 72 61 6d 45 72 72 | 3b 0d 7d 0d 0d 4f 53 45 |paramErr|;.}..OSE|
|00001200| 72 72 20 43 6c 65 61 72 | 53 74 72 69 6e 67 4c 69 |rr Clear|StringLi|
|00001210| 73 74 28 48 61 6e 64 6c | 65 20 6c 69 73 74 29 20 |st(Handl|e list) |
|00001220| 7b 0d 20 20 20 20 4f 53 | 45 72 72 20 65 72 72 3b |{. OS|Err err;|
|00001230| 0d 20 20 20 20 69 66 20 | 28 6c 69 73 74 20 3d 3d |. if |(list ==|
|00001240| 20 4e 55 4c 4c 29 20 72 | 65 74 75 72 6e 20 70 61 | NULL) r|eturn pa|
|00001250| 72 61 6d 45 72 72 3b 0d | 20 20 20 20 53 65 74 48 |ramErr;.| SetH|
|00001260| 61 6e 64 6c 65 53 69 7a | 65 28 6c 69 73 74 2c 20 |andleSiz|e(list, |
|00001270| 32 29 3b 0d 20 20 20 20 | 69 66 20 28 28 65 72 72 |2);. |if ((err|
|00001280| 20 3d 20 4d 65 6d 45 72 | 72 6f 72 28 29 29 20 21 | = MemEr|ror()) !|
|00001290| 3d 20 6e 6f 45 72 72 29 | 20 72 65 74 75 72 6e 20 |= noErr)| return |
|000012a0| 65 72 72 3b 0d 20 20 20 | 20 28 2a 2a 20 28 28 73 |err;. | (** ((s|
|000012b0| 68 6f 72 74 2a 2a 29 20 | 6c 69 73 74 29 29 20 3d |hort**) |list)) =|
|000012c0| 20 30 3b 0d 20 20 20 20 | 72 65 74 75 72 6e 20 6e | 0;. |return n|
|000012d0| 6f 45 72 72 3b 0d 7d 0d | 0d 73 68 6f 72 74 20 53 |oErr;.}.|.short S|
|000012e0| 74 72 69 6e 67 4c 69 73 | 74 49 6e 73 65 72 74 28 |tringLis|tInsert(|
|000012f0| 48 61 6e 64 6c 65 20 6c | 69 73 74 2c 20 53 74 72 |Handle l|ist, Str|
|00001300| 69 6e 67 50 74 72 20 73 | 29 20 7b 0d 20 20 20 20 |ingPtr s|) {. |
|00001310| 75 6e 73 69 67 6e 65 64 | 20 63 68 61 72 20 2a 73 |unsigned| char *s|
|00001320| 70 2c 20 2a 73 74 61 72 | 74 3b 0d 20 20 20 20 73 |p, *star|t;. s|
|00001330| 68 6f 72 74 20 69 2c 20 | 6e 3b 0d 20 20 20 20 63 |hort i, |n;. c|
|00001340| 68 61 72 20 73 74 61 74 | 65 3b 0d 20 20 20 20 4f |har stat|e;. O|
|00001350| 53 45 72 72 20 65 72 72 | 3b 0d 20 20 20 20 69 66 |SErr err|;. if|
|00001360| 20 28 6c 69 73 74 20 3d | 3d 20 4e 55 4c 4c 29 20 | (list =|= NULL) |
|00001370| 72 65 74 75 72 6e 20 30 | 3b 0d 20 20 20 20 73 74 |return 0|;. st|
|00001380| 61 74 65 20 3d 20 48 47 | 65 74 53 74 61 74 65 28 |ate = HG|etState(|
|00001390| 6c 69 73 74 29 3b 0d 20 | 20 20 20 6e 20 3d 20 2a |list);. | n = *|
|000013a0| 2a 20 28 28 73 68 6f 72 | 74 2a 2a 29 20 6c 69 73 |* ((shor|t**) lis|
|000013b0| 74 29 3b 0d 20 20 20 20 | 48 4c 6f 63 6b 28 6c 69 |t);. |HLock(li|
|000013c0| 73 74 29 3b 0d 20 20 20 | 20 73 70 20 3d 20 73 74 |st);. | sp = st|
|000013d0| 61 72 74 20 3d 20 28 75 | 6e 73 69 67 6e 65 64 20 |art = (u|nsigned |
|000013e0| 63 68 61 72 2a 29 20 28 | 2a 6c 69 73 74 29 3b 0d |char*) (|*list);.|
|000013f0| 20 20 20 20 66 6f 72 20 | 28 73 70 2b 3d 32 2c 20 | for |(sp+=2, |
|00001400| 69 3d 31 3b 20 69 3c 3d | 6e 3b 20 69 2b 2b 2c 20 |i=1; i<=|n; i++, |
|00001410| 73 70 20 2b 3d 20 2a 73 | 70 20 2b 20 31 29 0d 20 |sp += *s|p + 1). |
|00001420| 20 20 20 20 20 20 20 69 | 66 20 28 52 65 6c 53 74 | i|f (RelSt|
|00001430| 72 69 6e 67 28 73 2c 20 | 73 70 2c 20 53 4c 55 53 |ring(s, |sp, SLUS|
|00001440| 45 43 41 53 45 2c 20 74 | 72 75 65 29 20 3c 3d 20 |ECASE, t|rue) <= |
|00001450| 30 29 20 62 72 65 61 6b | 3b 0d 20 20 20 20 48 55 |0) break|;. HU|
|00001460| 6e 6c 6f 63 6b 28 6c 69 | 73 74 29 3b 0d 20 20 20 |nlock(li|st);. |
|00001470| 20 4d 75 6e 67 65 72 28 | 6c 69 73 74 2c 20 73 70 | Munger(|list, sp|
|00001480| 2d 73 74 61 72 74 2c 20 | 4e 55 4c 4c 2c 20 30 2c |-start, |NULL, 0,|
|00001490| 20 73 2c 20 2a 73 20 2b | 20 31 29 3b 0d 20 20 20 | s, *s +| 1);. |
|000014a0| 20 69 66 20 28 28 65 72 | 72 20 3d 20 4d 65 6d 45 | if ((er|r = MemE|
|000014b0| 72 72 6f 72 28 29 29 20 | 21 3d 20 6e 6f 45 72 72 |rror()) |!= noErr|
|000014c0| 29 20 72 65 74 75 72 6e | 20 30 3b 0d 20 20 20 20 |) return| 0;. |
|000014d0| 28 2a 2a 20 28 28 73 68 | 6f 72 74 2a 2a 29 20 6c |(** ((sh|ort**) l|
|000014e0| 69 73 74 29 29 20 2b 3d | 20 31 3b 0d 20 20 20 20 |ist)) +=| 1;. |
|000014f0| 48 53 65 74 53 74 61 74 | 65 28 6c 69 73 74 2c 20 |HSetStat|e(list, |
|00001500| 73 74 61 74 65 29 3b 0d | 20 20 20 20 72 65 74 75 |state);.| retu|
|00001510| 72 6e 20 69 3b 0d 7d 0d | 0d 4f 53 45 72 72 20 53 |rn i;.}.|.OSErr S|
|00001520| 74 72 69 6e 67 4c 69 73 | 74 49 6e 73 74 61 6c 6c |tringLis|tInstall|
|00001530| 28 48 61 6e 64 6c 65 20 | 6c 69 73 74 2c 20 73 68 |(Handle |list, sh|
|00001540| 6f 72 74 20 65 6c 74 2c | 20 53 74 72 69 6e 67 50 |ort elt,| StringP|
|00001550| 74 72 20 73 29 20 7b 0d | 20 20 20 20 75 6e 73 69 |tr s) {.| unsi|
|00001560| 67 6e 65 64 20 63 68 61 | 72 20 2a 73 70 2c 20 2a |gned cha|r *sp, *|
|00001570| 73 74 61 72 74 3b 0d 20 | 20 20 20 73 68 6f 72 74 |start;. | short|
|00001580| 20 69 2c 20 6e 3b 0d 20 | 20 20 20 4f 53 45 72 72 | i, n;. | OSErr|
|00001590| 20 65 72 72 3b 0d 20 20 | 20 20 69 66 20 28 6c 69 | err;. | if (li|
|000015a0| 73 74 20 3d 3d 20 4e 55 | 4c 4c 29 20 72 65 74 75 |st == NU|LL) retu|
|000015b0| 72 6e 20 70 61 72 61 6d | 45 72 72 3b 0d 20 20 20 |rn param|Err;. |
|000015c0| 20 6e 20 3d 20 2a 2a 20 | 28 28 73 68 6f 72 74 2a | n = ** |((short*|
|000015d0| 2a 29 20 6c 69 73 74 29 | 3b 0d 20 20 20 20 69 66 |*) list)|;. if|
|000015e0| 20 28 28 65 6c 74 20 3c | 20 31 29 29 20 7b 0d 20 | ((elt <| 1)) {. |
|000015f0| 20 20 20 20 20 20 20 72 | 65 74 75 72 6e 20 70 61 | r|eturn pa|
|00001600| 72 61 6d 45 72 72 3b 0d | 20 20 20 20 7d 20 65 6c |ramErr;.| } el|
|00001610| 73 65 20 69 66 20 28 65 | 6c 74 20 3e 20 6e 29 20 |se if (e|lt > n) |
|00001620| 7b 0d 20 20 20 20 20 20 | 20 20 69 66 20 28 28 65 |{. | if ((e|
|00001630| 72 72 20 3d 20 50 74 72 | 41 6e 64 48 61 6e 64 28 |rr = Ptr|AndHand(|
|00001640| 73 2c 20 6c 69 73 74 2c | 20 73 5b 30 5d 20 2b 20 |s, list,| s[0] + |
|00001650| 31 29 29 20 21 3d 20 6e | 6f 45 72 72 29 20 72 65 |1)) != n|oErr) re|
|00001660| 74 75 72 6e 20 65 72 72 | 3b 0d 20 20 20 20 20 20 |turn err|;. |
|00001670| 20 20 28 2a 2a 20 28 28 | 73 68 6f 72 74 2a 2a 29 | (** ((|short**)|
|00001680| 20 6c 69 73 74 29 29 20 | 2b 3d 20 31 3b 0d 20 20 | list)) |+= 1;. |
|00001690| 20 20 20 20 20 20 72 65 | 74 75 72 6e 20 6e 6f 45 | re|turn noE|
|000016a0| 72 72 3b 0d 20 20 20 20 | 7d 20 65 6c 73 65 20 7b |rr;. |} else {|
|000016b0| 0d 20 20 20 20 20 20 20 | 20 73 70 20 3d 20 73 74 |. | sp = st|
|000016c0| 61 72 74 20 3d 20 28 75 | 6e 73 69 67 6e 65 64 20 |art = (u|nsigned |
|000016d0| 63 68 61 72 2a 29 20 28 | 2a 6c 69 73 74 29 3b 0d |char*) (|*list);.|
|000016e0| 20 20 20 20 20 20 20 20 | 66 6f 72 20 28 73 70 2b | |for (sp+|
|000016f0| 3d 32 2c 20 69 3d 31 3b | 20 69 3c 3d 6e 3b 20 69 |=2, i=1;| i<=n; i|
|00001700| 2b 2b 2c 20 73 70 20 2b | 3d 20 2a 73 70 20 2b 20 |++, sp +|= *sp + |
|00001710| 31 29 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 69 |1). | i|
|00001720| 66 20 28 69 20 3d 3d 20 | 65 6c 74 29 20 62 72 65 |f (i == |elt) bre|
|00001730| 61 6b 3b 0d 20 20 20 20 | 20 20 20 20 4d 75 6e 67 |ak;. | Mung|
|00001740| 65 72 28 6c 69 73 74 2c | 20 73 70 2d 73 74 61 72 |er(list,| sp-star|
|00001750| 74 2c 20 4e 55 4c 4c 2c | 20 30 2c 20 73 2c 20 2a |t, NULL,| 0, s, *|
|00001760| 73 20 2b 20 31 29 3b 0d | 20 20 20 20 20 20 20 20 |s + 1);.| |
|00001770| 69 66 20 28 28 65 72 72 | 20 3d 20 4d 65 6d 45 72 |if ((err| = MemEr|
|00001780| 72 6f 72 28 29 29 20 21 | 3d 20 6e 6f 45 72 72 29 |ror()) !|= noErr)|
|00001790| 20 72 65 74 75 72 6e 20 | 65 72 72 3b 0d 20 20 20 | return |err;. |
|000017a0| 20 20 20 20 20 28 2a 2a | 20 28 28 73 68 6f 72 74 | (**| ((short|
|000017b0| 2a 2a 29 20 6c 69 73 74 | 29 29 20 2b 3d 20 31 3b |**) list|)) += 1;|
|000017c0| 0d 20 20 20 20 20 20 20 | 20 72 65 74 75 72 6e 20 |. | return |
|000017d0| 6e 6f 45 72 72 3b 0d 20 | 20 20 20 7d 0d 7d 0d 0d |noErr;. | }.}..|
|000017e0| 4f 53 45 72 72 20 53 74 | 72 69 6e 67 4c 69 73 74 |OSErr St|ringList|
|000017f0| 41 70 70 65 6e 64 28 48 | 61 6e 64 6c 65 20 6c 69 |Append(H|andle li|
|00001800| 73 74 2c 20 53 74 72 69 | 6e 67 50 74 72 20 73 29 |st, Stri|ngPtr s)|
|00001810| 20 7b 0d 20 20 20 20 72 | 65 74 75 72 6e 20 53 74 | {. r|eturn St|
|00001820| 72 69 6e 67 4c 69 73 74 | 49 6e 73 74 61 6c 6c 28 |ringList|Install(|
|00001830| 6c 69 73 74 2c 20 30 78 | 37 46 46 46 2c 20 73 29 |list, 0x|7FFF, s)|
|00001840| 3b 0d 7d 0d 0d 4f 53 45 | 72 72 20 53 74 72 69 6e |;.}..OSE|rr Strin|
|00001850| 67 4c 69 73 74 50 72 65 | 70 65 6e 64 28 48 61 6e |gListPre|pend(Han|
|00001860| 64 6c 65 20 6c 69 73 74 | 2c 20 53 74 72 69 6e 67 |dle list|, String|
|00001870| 50 74 72 20 73 29 20 7b | 0d 20 20 20 20 72 65 74 |Ptr s) {|. ret|
|00001880| 75 72 6e 20 53 74 72 69 | 6e 67 4c 69 73 74 49 6e |urn Stri|ngListIn|
|00001890| 73 74 61 6c 6c 28 6c 69 | 73 74 2c 20 31 2c 20 73 |stall(li|st, 1, s|
|000018a0| 29 3b 0d 7d 0d 0d 73 68 | 6f 72 74 20 53 74 72 69 |);.}..sh|ort Stri|
|000018b0| 6e 67 4c 69 73 74 52 49 | 6e 73 65 72 74 28 48 61 |ngListRI|nsert(Ha|
|000018c0| 6e 64 6c 65 20 6c 69 73 | 74 2c 20 53 74 72 69 6e |ndle lis|t, Strin|
|000018d0| 67 50 74 72 20 73 29 20 | 7b 0d 20 20 20 20 75 6e |gPtr s) |{. un|
|000018e0| 73 69 67 6e 65 64 20 63 | 68 61 72 20 2a 73 70 2c |signed c|har *sp,|
|000018f0| 20 2a 73 74 61 72 74 3b | 0d 20 20 20 20 73 68 6f | *start;|. sho|
|00001900| 72 74 20 69 2c 20 6e 3b | 0d 20 20 20 20 63 68 61 |rt i, n;|. cha|
|00001910| 72 20 73 74 61 74 65 3b | 0d 20 20 20 20 69 66 20 |r state;|. if |
|00001920| 28 6c 69 73 74 20 3d 3d | 20 4e 55 4c 4c 29 20 72 |(list ==| NULL) r|
|00001930| 65 74 75 72 6e 20 30 3b | 0d 20 20 20 20 6e 20 3d |eturn 0;|. n =|
|00001940| 20 2a 2a 20 28 28 73 68 | 6f 72 74 2a 2a 29 20 6c | ** ((sh|ort**) l|
|00001950| 69 73 74 29 3b 0d 20 20 | 20 20 73 74 61 74 65 20 |ist);. | state |
|00001960| 3d 20 48 47 65 74 53 74 | 61 74 65 28 6c 69 73 74 |= HGetSt|ate(list|
|00001970| 29 3b 0d 20 20 20 20 69 | 66 20 28 4d 65 6d 45 72 |);. i|f (MemEr|
|00001980| 72 6f 72 28 29 20 21 3d | 20 6e 6f 45 72 72 29 20 |ror() !=| noErr) |
|00001990| 72 65 74 75 72 6e 20 30 | 3b 0d 20 20 20 20 48 4c |return 0|;. HL|
|000019a0| 6f 63 6b 28 6c 69 73 74 | 29 3b 0d 20 20 20 20 73 |ock(list|);. s|
|000019b0| 70 20 3d 20 73 74 61 72 | 74 20 3d 20 28 75 6e 73 |p = star|t = (uns|
|000019c0| 69 67 6e 65 64 20 63 68 | 61 72 2a 29 20 28 2a 6c |igned ch|ar*) (*l|
|000019d0| 69 73 74 29 3b 0d 20 20 | 20 20 66 6f 72 20 28 73 |ist);. | for (s|
|000019e0| 70 2b 3d 32 2c 20 69 3d | 31 3b 20 69 3c 3d 6e 3b |p+=2, i=|1; i<=n;|
|000019f0| 20 69 2b 2b 2c 20 73 70 | 20 2b 3d 20 2a 73 70 20 | i++, sp| += *sp |
|00001a00| 2b 20 31 29 0d 20 20 20 | 20 20 20 20 20 69 66 20 |+ 1). | if |
|00001a10| 28 52 65 6c 53 74 72 69 | 6e 67 28 73 2c 20 73 70 |(RelStri|ng(s, sp|
|00001a20| 2c 20 66 61 6c 73 65 2c | 20 74 72 75 65 29 20 3e |, false,| true) >|
|00001a30| 3d 20 30 29 20 62 72 65 | 61 6b 3b 0d 20 20 20 20 |= 0) bre|ak;. |
|00001a40| 48 55 6e 6c 6f 63 6b 28 | 6c 69 73 74 29 3b 0d 20 |HUnlock(|list);. |
|00001a50| 20 20 20 4d 75 6e 67 65 | 72 28 6c 69 73 74 2c 20 | Munge|r(list, |
|00001a60| 73 70 2d 73 74 61 72 74 | 2c 20 4e 55 4c 4c 2c 20 |sp-start|, NULL, |
|00001a70| 30 2c 20 73 2c 20 2a 73 | 20 2b 20 31 29 3b 0d 20 |0, s, *s| + 1);. |
|00001a80| 20 20 20 69 66 20 28 4d | 65 6d 45 72 72 6f 72 28 | if (M|emError(|
|00001a90| 29 20 21 3d 20 6e 6f 45 | 72 72 29 20 72 65 74 75 |) != noE|rr) retu|
|00001aa0| 72 6e 20 30 3b 0d 20 20 | 20 20 28 2a 2a 20 28 28 |rn 0;. | (** ((|
|00001ab0| 73 68 6f 72 74 2a 2a 29 | 20 6c 69 73 74 29 29 20 |short**)| list)) |
|00001ac0| 2b 3d 20 31 3b 0d 20 20 | 20 20 48 53 65 74 53 74 |+= 1;. | HSetSt|
|00001ad0| 61 74 65 28 6c 69 73 74 | 2c 20 73 74 61 74 65 29 |ate(list|, state)|
|00001ae0| 3b 0d 20 20 20 20 72 65 | 74 75 72 6e 20 69 3b 0d |;. re|turn i;.|
|00001af0| 7d 0d 0d 73 68 6f 72 74 | 20 46 69 6e 64 53 74 72 |}..short| FindStr|
|00001b00| 69 6e 67 4c 69 73 74 28 | 48 61 6e 64 6c 65 20 6c |ingList(|Handle l|
|00001b10| 69 73 74 2c 20 53 74 72 | 69 6e 67 50 74 72 20 73 |ist, Str|ingPtr s|
|00001b20| 29 20 7b 0d 20 20 20 20 | 75 6e 73 69 67 6e 65 64 |) {. |unsigned|
|00001b30| 20 63 68 61 72 20 2a 73 | 70 2c 20 2a 73 74 61 72 | char *s|p, *star|
|00001b40| 74 3b 0d 20 20 20 20 73 | 68 6f 72 74 20 69 2c 20 |t;. s|hort i, |
|00001b50| 6e 3b 0d 20 20 20 20 63 | 68 61 72 20 73 74 61 74 |n;. c|har stat|
|00001b60| 65 3b 0d 20 20 20 20 69 | 66 20 28 6c 69 73 74 20 |e;. i|f (list |
|00001b70| 3d 3d 20 4e 55 4c 4c 29 | 20 72 65 74 75 72 6e 20 |== NULL)| return |
|00001b80| 30 3b 0d 20 20 20 20 6e | 20 3d 20 2a 2a 20 28 28 |0;. n| = ** ((|
|00001b90| 73 68 6f 72 74 2a 2a 29 | 20 6c 69 73 74 29 3b 0d |short**)| list);.|
|00001ba0| 20 20 20 20 73 74 61 74 | 65 20 3d 20 48 47 65 74 | stat|e = HGet|
|00001bb0| 53 74 61 74 65 28 6c 69 | 73 74 29 3b 0d 20 20 20 |State(li|st);. |
|00001bc0| 20 48 4c 6f 63 6b 28 6c | 69 73 74 29 3b 0d 20 20 | HLock(l|ist);. |
|00001bd0| 20 20 73 70 20 3d 20 73 | 74 61 72 74 20 3d 20 28 | sp = s|tart = (|
|00001be0| 75 6e 73 69 67 6e 65 64 | 20 63 68 61 72 2a 29 20 |unsigned| char*) |
|00001bf0| 28 2a 6c 69 73 74 29 3b | 0d 20 20 20 20 66 6f 72 |(*list);|. for|
|00001c00| 20 28 73 70 2b 3d 32 2c | 20 69 3d 31 3b 20 69 3c | (sp+=2,| i=1; i<|
|00001c10| 3d 6e 3b 20 69 2b 2b 2c | 20 73 70 20 2b 3d 20 2a |=n; i++,| sp += *|
|00001c20| 73 70 20 2b 20 31 29 0d | 20 20 20 20 20 20 20 20 |sp + 1).| |
|00001c30| 69 66 20 28 52 65 6c 53 | 74 72 69 6e 67 28 73 2c |if (RelS|tring(s,|
|00001c40| 20 73 70 2c 20 53 4c 55 | 53 45 43 41 53 45 2c 20 | sp, SLU|SECASE, |
|00001c50| 74 72 75 65 29 20 3d 3d | 20 30 29 20 62 72 65 61 |true) ==| 0) brea|
|00001c60| 6b 3b 0d 20 20 20 20 48 | 53 65 74 53 74 61 74 65 |k;. H|SetState|
|00001c70| 28 6c 69 73 74 2c 20 73 | 74 61 74 65 29 3b 0d 20 |(list, s|tate);. |
|00001c80| 20 20 20 72 65 74 75 72 | 6e 20 28 69 20 3c 3d 20 | retur|n (i <= |
|00001c90| 6e 20 3f 20 69 20 3a 20 | 30 29 3b 0d 7d 0d 0d 4d |n ? i : |0);.}..M|
|00001ca0| 65 6e 75 48 61 6e 64 6c | 65 20 53 74 72 69 6e 67 |enuHandl|e String|
|00001cb0| 4c 69 73 74 54 6f 4d 65 | 6e 75 28 48 61 6e 64 6c |ListToMe|nu(Handl|
|00001cc0| 65 20 6c 69 73 74 2c 20 | 73 68 6f 72 74 20 69 64 |e list, |short id|
|00001cd0| 2c 20 53 74 72 69 6e 67 | 50 74 72 20 6e 61 6d 65 |, String|Ptr name|
|00001ce0| 29 20 7b 0d 20 20 20 20 | 4d 65 6e 75 48 61 6e 64 |) {. |MenuHand|
|00001cf0| 6c 65 20 6d 6e 75 3b 0d | 20 20 20 20 73 68 6f 72 |le mnu;.| shor|
|00001d00| 74 20 69 2c 20 6e 3b 0d | 20 20 20 20 63 68 61 72 |t i, n;.| char|
|00001d10| 20 73 74 61 74 65 3b 0d | 20 20 20 20 75 6e 73 69 | state;.| unsi|
|00001d20| 67 6e 65 64 20 63 68 61 | 72 20 2a 73 70 3b 0d 20 |gned cha|r *sp;. |
|00001d30| 20 20 20 69 66 20 28 6c | 69 73 74 20 21 3d 20 4e | if (l|ist != N|
|00001d40| 55 4c 4c 29 20 7b 0d 20 | 20 20 20 20 20 20 20 6e |ULL) {. | n|
|00001d50| 20 3d 20 2a 2a 20 28 28 | 73 68 6f 72 74 2a 2a 29 | = ** ((|short**)|
|00001d60| 20 6c 69 73 74 29 3b 0d | 20 20 20 20 20 20 20 20 | list);.| |
|00001d70| 73 74 61 74 65 20 3d 20 | 48 47 65 74 53 74 61 74 |state = |HGetStat|
|00001d80| 65 28 6c 69 73 74 29 3b | 0d 20 20 20 20 20 20 20 |e(list);|. |
|00001d90| 20 48 4c 6f 63 6b 28 6c | 69 73 74 29 3b 0d 20 20 | HLock(l|ist);. |
|00001da0| 20 20 20 20 20 20 6d 6e | 75 20 3d 20 4e 65 77 4d | mn|u = NewM|
|00001db0| 65 6e 75 28 69 64 2c 20 | 28 6e 61 6d 65 3d 3d 4e |enu(id, |(name==N|
|00001dc0| 55 4c 4c 20 3f 20 22 5c | 70 53 54 52 23 22 20 3a |ULL ? "\|pSTR#" :|
|00001dd0| 20 6e 61 6d 65 29 29 3b | 0d 20 20 20 20 20 20 20 | name));|. |
|00001de0| 20 69 66 20 28 6d 6e 75 | 20 21 3d 20 4e 55 4c 4c | if (mnu| != NULL|
|00001df0| 29 20 7b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |) {. | |
|00001e00| 73 70 20 3d 20 28 75 6e | 73 69 67 6e 65 64 20 63 |sp = (un|signed c|
|00001e10| 68 61 72 2a 29 20 28 2a | 6c 69 73 74 29 3b 0d 20 |har*) (*|list);. |
|00001e20| 20 20 20 20 20 20 20 20 | 20 20 20 66 6f 72 20 28 | | for (|
|00001e30| 73 70 2b 3d 32 2c 20 69 | 3d 31 3b 20 69 3c 3d 6e |sp+=2, i|=1; i<=n|
|00001e40| 3b 20 69 2b 2b 2c 20 73 | 70 20 2b 3d 20 2a 73 70 |; i++, s|p += *sp|
|00001e50| 20 2b 20 31 29 20 7b 0d | 23 69 66 64 65 66 20 49 | + 1) {.|#ifdef I|
|00001e60| 4e 54 45 52 50 52 45 54 | 4d 45 4e 55 43 48 41 52 |NTERPRET|MENUCHAR|
|00001e70| 53 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |S. | |
|00001e80| 20 20 41 70 70 65 6e 64 | 4d 65 6e 75 28 6d 6e 75 | Append|Menu(mnu|
|00001e90| 2c 20 73 70 29 3b 0d 23 | 65 6c 73 65 0d 20 20 20 |, sp);.#|else. |
|00001ea0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 41 70 70 | | App|
|00001eb0| 65 6e 64 4d 65 6e 75 28 | 6d 6e 75 2c 20 22 5c 70 |endMenu(|mnu, "\p|
|00001ec0| 44 41 54 41 22 29 3b 0d | 20 20 20 20 20 20 20 20 |DATA");.| |
|00001ed0| 20 20 20 20 20 20 20 20 | 53 65 74 49 74 65 6d 28 | |SetItem(|
|00001ee0| 6d 6e 75 2c 20 69 2c 20 | 73 70 29 3b 0d 23 65 6e |mnu, i, |sp);.#en|
|00001ef0| 64 69 66 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |dif. | |
|00001f00| 7d 0d 20 20 20 20 20 20 | 20 20 7d 0d 20 20 20 20 |}. | }. |
|00001f10| 20 20 20 20 48 53 65 74 | 53 74 61 74 65 28 6c 69 | HSet|State(li|
|00001f20| 73 74 2c 20 73 74 61 74 | 65 29 3b 0d 20 20 20 20 |st, stat|e);. |
|00001f30| 20 20 20 20 72 65 74 75 | 72 6e 20 6d 6e 75 3b 0d | retu|rn mnu;.|
|00001f40| 20 20 20 20 7d 20 65 6c | 73 65 20 72 65 74 75 72 | } el|se retur|
|00001f50| 6e 20 4e 55 4c 4c 3b 0d | 7d 0d 0d 76 6f 69 64 20 |n NULL;.|}..void |
|00001f60| 53 74 72 69 6e 67 4c 69 | 73 74 54 6f 4c 69 73 74 |StringLi|stToList|
|00001f70| 28 48 61 6e 64 6c 65 20 | 6c 69 73 74 2c 20 4c 69 |(Handle |list, Li|
|00001f80| 73 74 48 61 6e 64 6c 65 | 20 74 68 65 5f 6c 69 73 |stHandle| the_lis|
|00001f90| 74 29 20 7b 0d 20 20 20 | 20 73 68 6f 72 74 20 69 |t) {. | short i|
|00001fa0| 2c 20 6e 3b 0d 20 20 20 | 20 63 68 61 72 20 73 74 |, n;. | char st|
|00001fb0| 61 74 65 3b 0d 20 20 20 | 20 75 6e 73 69 67 6e 65 |ate;. | unsigne|
|00001fc0| 64 20 63 68 61 72 2a 20 | 73 70 3b 0d 20 20 20 20 |d char* |sp;. |
|00001fd0| 43 65 6c 6c 20 74 68 65 | 43 65 6c 6c 3b 0d 20 20 |Cell the|Cell;. |
|00001fe0| 20 20 69 66 20 28 6c 69 | 73 74 20 21 3d 20 4e 55 | if (li|st != NU|
|00001ff0| 4c 4c 29 20 7b 0d 20 20 | 20 20 20 20 20 20 6e 20 |LL) {. | n |
|00002000| 3d 20 2a 2a 20 28 28 73 | 68 6f 72 74 2a 2a 29 20 |= ** ((s|hort**) |
|00002010| 6c 69 73 74 29 3b 0d 20 | 20 20 20 20 20 20 20 4c |list);. | L|
|00002020| 44 65 6c 52 6f 77 28 30 | 2c 20 30 2c 20 74 68 65 |DelRow(0|, 0, the|
|00002030| 5f 6c 69 73 74 29 3b 0d | 20 20 20 20 20 20 20 20 |_list);.| |
|00002040| 4c 41 64 64 52 6f 77 28 | 53 74 72 69 6e 67 4c 69 |LAddRow(|StringLi|
|00002050| 73 74 53 69 7a 65 28 6c | 69 73 74 29 2c 20 30 2c |stSize(l|ist), 0,|
|00002060| 20 74 68 65 5f 6c 69 73 | 74 29 3b 0d 20 20 20 20 | the_lis|t);. |
|00002070| 20 20 20 20 73 74 61 74 | 65 20 3d 20 48 47 65 74 | stat|e = HGet|
|00002080| 53 74 61 74 65 28 6c 69 | 73 74 29 3b 0d 20 20 20 |State(li|st);. |
|00002090| 20 20 20 20 20 48 4c 6f | 63 6b 28 6c 69 73 74 29 | HLo|ck(list)|
|000020a0| 3b 0d 20 20 20 20 20 20 | 20 20 73 70 20 3d 20 28 |;. | sp = (|
|000020b0| 75 6e 73 69 67 6e 65 64 | 20 63 68 61 72 2a 29 20 |unsigned| char*) |
|000020c0| 28 2a 6c 69 73 74 29 3b | 0d 20 20 20 20 20 20 20 |(*list);|. |
|000020d0| 20 66 6f 72 20 28 73 70 | 2b 3d 32 2c 20 69 3d 31 | for (sp|+=2, i=1|
|000020e0| 3b 20 69 3c 3d 6e 3b 20 | 69 2b 2b 2c 20 73 70 20 |; i<=n; |i++, sp |
|000020f0| 2b 3d 20 2a 73 70 20 2b | 20 31 29 20 7b 0d 20 20 |+= *sp +| 1) {. |
|00002100| 20 20 20 20 20 20 20 20 | 20 20 53 65 74 50 74 28 | | SetPt(|
|00002110| 26 74 68 65 43 65 6c 6c | 2c 20 30 2c 20 69 2d 31 |&theCell|, 0, i-1|
|00002120| 29 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 4c |);. | L|
|00002130| 53 65 74 43 65 6c 6c 28 | 73 70 20 2b 20 31 2c 20 |SetCell(|sp + 1, |
|00002140| 73 70 5b 30 5d 2c 20 74 | 68 65 43 65 6c 6c 2c 20 |sp[0], t|heCell, |
|00002150| 74 68 65 5f 6c 69 73 74 | 29 3b 0d 20 20 20 20 20 |the_list|);. |
|00002160| 20 20 20 7d 0d 20 20 20 | 20 20 20 20 20 48 53 65 | }. | HSe|
|00002170| 74 53 74 61 74 65 28 6c | 69 73 74 2c 20 73 74 61 |tState(l|ist, sta|
|00002180| 74 65 29 3b 0d 20 20 20 | 20 7d 0d 7d 0d 0d 73 74 |te);. | }.}..st|
|00002190| 61 74 69 63 20 53 74 72 | 69 6e 67 50 74 72 2a 2a |atic Str|ingPtr**|
|000021a0| 20 4d 61 6b 65 53 74 72 | 69 6e 67 4c 69 73 74 4d | MakeStr|ingListM|
|000021b0| 61 70 28 48 61 6e 64 6c | 65 20 6c 69 73 74 29 20 |ap(Handl|e list) |
|000021c0| 7b 0d 20 20 20 20 75 6e | 73 69 67 6e 65 64 20 63 |{. un|signed c|
|000021d0| 68 61 72 20 2a 73 70 3b | 0d 20 20 20 20 73 68 6f |har *sp;|. sho|
|000021e0| 72 74 20 69 2c 20 6e 3b | 0d 20 20 20 20 53 74 72 |rt i, n;|. Str|
|000021f0| 69 6e 67 50 74 72 2a 2a | 20 74 68 65 5f 61 72 72 |ingPtr**| the_arr|
|00002200| 61 79 2c 20 2a 72 6f 76 | 65 72 3b 0d 20 20 20 20 |ay, *rov|er;. |
|00002210| 69 66 20 28 6c 69 73 74 | 20 21 3d 20 4e 55 4c 4c |if (list| != NULL|
|00002220| 29 20 7b 0d 20 20 20 20 | 20 20 20 20 6e 20 3d 20 |) {. | n = |
|00002230| 2a 2a 20 28 28 73 68 6f | 72 74 2a 2a 29 20 6c 69 |** ((sho|rt**) li|
|00002240| 73 74 29 3b 0d 20 20 20 | 20 20 20 20 20 74 68 65 |st);. | the|
|00002250| 5f 61 72 72 61 79 20 3d | 20 28 53 74 72 69 6e 67 |_array =| (String|
|00002260| 50 74 72 2a 2a 29 20 4e | 65 77 48 61 6e 64 6c 65 |Ptr**) N|ewHandle|
|00002270| 28 6e 20 2a 20 73 69 7a | 65 6f 66 28 53 74 72 69 |(n * siz|eof(Stri|
|00002280| 6e 67 50 74 72 29 29 3b | 0d 20 20 20 20 20 20 20 |ngPtr));|. |
|00002290| 20 69 66 20 28 74 68 65 | 5f 61 72 72 61 79 20 21 | if (the|_array !|
|000022a0| 3d 20 4e 55 4c 4c 29 20 | 7b 0d 20 20 20 20 20 20 |= NULL) |{. |
|000022b0| 20 20 20 20 20 20 4d 6f | 76 65 48 48 69 28 6c 69 | Mo|veHHi(li|
|000022c0| 73 74 29 3b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |st);. | |
|000022d0| 20 48 4c 6f 63 6b 28 6c | 69 73 74 29 3b 0d 20 20 | HLock(l|ist);. |
|000022e0| 20 20 20 20 20 20 20 20 | 20 20 73 70 20 3d 20 28 | | sp = (|
|000022f0| 75 6e 73 69 67 6e 65 64 | 20 63 68 61 72 2a 29 20 |unsigned| char*) |
|00002300| 28 2a 6c 69 73 74 29 3b | 0d 20 20 20 20 20 20 20 |(*list);|. |
|00002310| 20 20 20 20 20 72 6f 76 | 65 72 20 3d 20 2a 74 68 | rov|er = *th|
|00002320| 65 5f 61 72 72 61 79 3b | 0d 20 20 20 20 20 20 20 |e_array;|. |
|00002330| 20 20 20 20 20 66 6f 72 | 20 28 73 70 2b 3d 32 2c | for| (sp+=2,|
|00002340| 20 69 3d 31 3b 20 69 3c | 3d 6e 3b 20 69 2b 2b 2c | i=1; i<|=n; i++,|
|00002350| 20 73 70 20 2b 3d 20 2a | 73 70 20 2b 20 31 29 20 | sp += *|sp + 1) |
|00002360| 2a 72 6f 76 65 72 2b 2b | 20 3d 20 73 70 3b 0d 20 |*rover++| = sp;. |
|00002370| 20 20 20 20 20 20 20 7d | 0d 20 20 20 20 20 20 20 | }|. |
|00002380| 20 72 65 74 75 72 6e 20 | 74 68 65 5f 61 72 72 61 | return |the_arra|
|00002390| 79 3b 0d 20 20 20 20 7d | 20 65 6c 73 65 20 72 65 |y;. }| else re|
|000023a0| 74 75 72 6e 20 4e 55 4c | 4c 3b 0d 7d 0d 0d 73 74 |turn NUL|L;.}..st|
|000023b0| 61 74 69 63 20 69 6e 74 | 20 53 54 52 43 6f 6d 70 |atic int| STRComp|
|000023c0| 61 72 65 28 63 6f 6e 73 | 74 20 76 6f 69 64 20 2a |are(cons|t void *|
|000023d0| 61 2c 20 63 6f 6e 73 74 | 20 76 6f 69 64 20 2a 62 |a, const| void *b|
|000023e0| 29 20 7b 0d 20 20 20 20 | 72 65 74 75 72 6e 20 52 |) {. |return R|
|000023f0| 65 6c 53 74 72 69 6e 67 | 28 2a 20 28 28 53 74 72 |elString|(* ((Str|
|00002400| 69 6e 67 50 74 72 2a 29 | 20 61 29 2c 2a 20 28 28 |ingPtr*)| a),* ((|
|00002410| 53 74 72 69 6e 67 50 74 | 72 2a 29 20 62 29 2c 20 |StringPt|r*) b), |
|00002420| 53 4c 55 53 45 43 41 53 | 45 2c 20 74 72 75 65 29 |SLUSECAS|E, true)|
|00002430| 3b 0d 7d 0d 0d 73 74 61 | 74 69 63 20 53 74 72 69 |;.}..sta|tic Stri|
|00002440| 6e 67 50 74 72 2a 2a 20 | 4d 61 6b 65 53 6f 72 74 |ngPtr** |MakeSort|
|00002450| 65 64 53 74 72 69 6e 67 | 4c 69 73 74 4d 61 70 28 |edString|ListMap(|
|00002460| 48 61 6e 64 6c 65 20 6c | 69 73 74 29 20 7b 0d 20 |Handle l|ist) {. |
|00002470| 20 20 20 53 74 72 69 6e | 67 50 74 72 2a 2a 20 74 | Strin|gPtr** t|
|00002480| 68 65 5f 6d 61 70 3b 0d | 20 20 20 20 73 68 6f 72 |he_map;.| shor|
|00002490| 74 20 6e 3b 0d 20 20 20 | 20 74 68 65 5f 6d 61 70 |t n;. | the_map|
|000024a0| 20 3d 20 4d 61 6b 65 53 | 74 72 69 6e 67 4c 69 73 | = MakeS|tringLis|
|000024b0| 74 4d 61 70 28 6c 69 73 | 74 29 3b 0d 20 20 20 20 |tMap(lis|t);. |
|000024c0| 69 66 20 28 74 68 65 5f | 6d 61 70 20 21 3d 20 4e |if (the_|map != N|
|000024d0| 55 4c 4c 29 20 7b 0d 20 | 20 20 20 20 20 20 20 6e |ULL) {. | n|
|000024e0| 20 3d 20 2a 2a 20 28 28 | 73 68 6f 72 74 2a 2a 29 | = ** ((|short**)|
|000024f0| 20 6c 69 73 74 29 3b 0d | 20 20 20 20 20 20 20 20 | list);.| |
|00002500| 48 4c 6f 63 6b 28 28 48 | 61 6e 64 6c 65 29 20 74 |HLock((H|andle) t|
|00002510| 68 65 5f 6d 61 70 29 3b | 0d 20 20 20 20 20 20 20 |he_map);|. |
|00002520| 20 71 73 6f 72 74 28 2a | 74 68 65 5f 6d 61 70 2c | qsort(*|the_map,|
|00002530| 20 6e 2c 20 73 69 7a 65 | 6f 66 28 53 74 72 69 6e | n, size|of(Strin|
|00002540| 67 50 74 72 29 2c 20 53 | 54 52 43 6f 6d 70 61 72 |gPtr), S|TRCompar|
|00002550| 65 29 3b 0d 20 20 20 20 | 20 20 20 20 48 55 6e 6c |e);. | HUnl|
|00002560| 6f 63 6b 28 28 48 61 6e | 64 6c 65 29 20 74 68 65 |ock((Han|dle) the|
|00002570| 5f 6d 61 70 29 3b 0d 20 | 20 20 20 7d 0d 20 20 20 |_map);. | }. |
|00002580| 20 72 65 74 75 72 6e 20 | 74 68 65 5f 6d 61 70 3b | return |the_map;|
|00002590| 0d 7d 0d 0d 48 61 6e 64 | 6c 65 20 53 74 72 69 6e |.}..Hand|le Strin|
|000025a0| 67 4c 69 73 74 55 6e 69 | 6f 6e 28 48 61 6e 64 6c |gListUni|on(Handl|
|000025b0| 65 20 41 2c 20 48 61 6e | 64 6c 65 20 42 29 20 7b |e A, Han|dle B) {|
|000025c0| 0d 20 20 20 20 53 74 72 | 69 6e 67 50 74 72 20 2a |. Str|ingPtr *|
|000025d0| 2a 41 4d 61 70 20 3d 20 | 4e 55 4c 4c 2c 20 2a 2a |*AMap = |NULL, **|
|000025e0| 42 4d 61 70 20 3d 20 4e | 55 4c 4c 2c 20 73 74 72 |BMap = N|ULL, str|
|000025f0| 61 2c 20 73 74 72 62 3b | 0d 20 20 20 20 48 61 6e |a, strb;|. Han|
|00002600| 64 6c 65 20 72 65 73 75 | 6c 74 20 3d 20 4e 55 4c |dle resu|lt = NUL|
|00002610| 4c 3b 0d 20 20 20 20 73 | 68 6f 72 74 20 61 63 6f |L;. s|hort aco|
|00002620| 75 6e 74 2c 20 62 63 6f | 75 6e 74 2c 20 69 2c 20 |unt, bco|unt, i, |
|00002630| 6a 2c 20 63 6d 70 3b 0d | 20 20 20 20 69 66 20 28 |j, cmp;.| if (|
|00002640| 28 72 65 73 75 6c 74 20 | 3d 20 4e 65 77 53 74 72 |(result |= NewStr|
|00002650| 69 6e 67 4c 69 73 74 28 | 29 29 20 3d 3d 20 4e 55 |ingList(|)) == NU|
|00002660| 4c 4c 29 20 67 6f 74 6f | 20 75 6e 69 6f 6e 5f 61 |LL) goto| union_a|
|00002670| 62 6f 72 74 3b 0d 20 20 | 20 20 69 66 20 28 28 41 |bort;. | if ((A|
|00002680| 4d 61 70 20 3d 20 4d 61 | 6b 65 53 6f 72 74 65 64 |Map = Ma|keSorted|
|00002690| 53 74 72 69 6e 67 4c 69 | 73 74 4d 61 70 28 41 29 |StringLi|stMap(A)|
|000026a0| 29 20 3d 3d 20 4e 55 4c | 4c 29 20 67 6f 74 6f 20 |) == NUL|L) goto |
|000026b0| 75 6e 69 6f 6e 5f 61 62 | 6f 72 74 3b 0d 20 20 20 |union_ab|ort;. |
|000026c0| 20 69 66 20 28 28 42 4d | 61 70 20 3d 20 4d 61 6b | if ((BM|ap = Mak|
|000026d0| 65 53 6f 72 74 65 64 53 | 74 72 69 6e 67 4c 69 73 |eSortedS|tringLis|
|000026e0| 74 4d 61 70 28 42 29 29 | 20 3d 3d 20 4e 55 4c 4c |tMap(B))| == NULL|
|000026f0| 29 20 67 6f 74 6f 20 75 | 6e 69 6f 6e 5f 61 62 6f |) goto u|nion_abo|
|00002700| 72 74 3b 0d 20 20 20 20 | 61 63 6f 75 6e 74 20 3d |rt;. |acount =|
|00002710| 20 53 74 72 69 6e 67 4c | 69 73 74 53 69 7a 65 28 | StringL|istSize(|
|00002720| 41 29 3b 0d 20 20 20 20 | 62 63 6f 75 6e 74 20 3d |A);. |bcount =|
|00002730| 20 53 74 72 69 6e 67 4c | 69 73 74 53 69 7a 65 28 | StringL|istSize(|
|00002740| 42 29 3b 0d 20 20 20 20 | 69 20 3d 20 6a 20 3d 20 |B);. |i = j = |
|00002750| 30 3b 0d 20 20 20 20 77 | 68 69 6c 65 20 28 69 20 |0;. w|hile (i |
|00002760| 3c 20 61 63 6f 75 6e 74 | 20 26 26 20 6a 20 3c 20 |< acount| && j < |
|00002770| 62 63 6f 75 6e 74 29 20 | 7b 0d 20 20 20 20 20 20 |bcount) |{. |
|00002780| 20 20 63 6d 70 20 3d 20 | 52 65 6c 53 74 72 69 6e | cmp = |RelStrin|
|00002790| 67 28 28 73 74 72 61 20 | 3d 20 28 2a 41 4d 61 70 |g((stra |= (*AMap|
|000027a0| 29 5b 69 5d 29 2c 20 28 | 73 74 72 62 20 3d 20 28 |)[i]), (|strb = (|
|000027b0| 2a 42 4d 61 70 29 5b 6a | 5d 29 2c 0d 20 20 20 20 |*BMap)[j|]),. |
|000027c0| 20 20 20 20 20 20 20 20 | 53 4c 55 53 45 43 41 53 | |SLUSECAS|
|000027d0| 45 2c 20 74 72 75 65 29 | 3b 0d 20 20 20 20 20 20 |E, true)|;. |
|000027e0| 20 20 69 66 20 28 63 6d | 70 20 3d 3d 20 30 29 20 | if (cm|p == 0) |
|000027f0| 7b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 53 74 |{. | St|
|00002800| 72 69 6e 67 4c 69 73 74 | 41 70 70 65 6e 64 28 72 |ringList|Append(r|
|00002810| 65 73 75 6c 74 2c 20 73 | 74 72 61 29 3b 0d 20 20 |esult, s|tra);. |
|00002820| 20 20 20 20 20 20 20 20 | 20 20 69 2b 2b 3b 20 6a | | i++; j|
|00002830| 2b 2b 3b 0d 20 20 20 20 | 20 20 20 20 7d 20 65 6c |++;. | } el|
|00002840| 73 65 20 69 66 20 28 63 | 6d 70 20 3c 20 30 29 20 |se if (c|mp < 0) |
|00002850| 7b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 53 74 |{. | St|
|00002860| 72 69 6e 67 4c 69 73 74 | 41 70 70 65 6e 64 28 72 |ringList|Append(r|
|00002870| 65 73 75 6c 74 2c 20 73 | 74 72 61 29 3b 0d 20 20 |esult, s|tra);. |
|00002880| 20 20 20 20 20 20 20 20 | 20 20 69 2b 2b 3b 0d 20 | | i++;. |
|00002890| 20 20 20 20 20 20 20 7d | 20 65 6c 73 65 20 7b 0d | }| else {.|
|000028a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 53 74 72 69 | | Stri|
|000028b0| 6e 67 4c 69 73 74 41 70 | 70 65 6e 64 28 72 65 73 |ngListAp|pend(res|
|000028c0| 75 6c 74 2c 20 73 74 72 | 62 29 3b 0d 20 20 20 20 |ult, str|b);. |
|000028d0| 20 20 20 20 20 20 20 20 | 6a 2b 2b 3b 0d 20 20 20 | |j++;. |
|000028e0| 20 20 20 20 20 7d 0d 20 | 20 20 20 7d 0d 20 20 20 | }. | }. |
|000028f0| 20 77 68 69 6c 65 20 28 | 69 20 3c 20 61 63 6f 75 | while (|i < acou|
|00002900| 6e 74 29 20 53 74 72 69 | 6e 67 4c 69 73 74 41 70 |nt) Stri|ngListAp|
|00002910| 70 65 6e 64 28 72 65 73 | 75 6c 74 2c 20 28 2a 41 |pend(res|ult, (*A|
|00002920| 4d 61 70 29 5b 69 2b 2b | 5d 29 3b 0d 20 20 20 20 |Map)[i++|]);. |
|00002930| 77 68 69 6c 65 20 28 6a | 20 3c 20 62 63 6f 75 6e |while (j| < bcoun|
|00002940| 74 29 20 53 74 72 69 6e | 67 4c 69 73 74 41 70 70 |t) Strin|gListApp|
|00002950| 65 6e 64 28 72 65 73 75 | 6c 74 2c 20 28 2a 42 4d |end(resu|lt, (*BM|
|00002960| 61 70 29 5b 6a 2b 2b 5d | 29 3b 0d 20 20 20 20 44 |ap)[j++]|);. D|
|00002970| 69 73 70 6f 73 65 48 61 | 6e 64 6c 65 28 28 48 61 |isposeHa|ndle((Ha|
|00002980| 6e 64 6c 65 29 20 41 4d | 61 70 29 3b 20 48 55 6e |ndle) AM|ap); HUn|
|00002990| 6c 6f 63 6b 28 41 29 3b | 0d 20 20 20 20 44 69 73 |lock(A);|. Dis|
|000029a0| 70 6f 73 65 48 61 6e 64 | 6c 65 28 28 48 61 6e 64 |poseHand|le((Hand|
|000029b0| 6c 65 29 20 42 4d 61 70 | 29 3b 20 48 55 6e 6c 6f |le) BMap|); HUnlo|
|000029c0| 63 6b 28 42 29 3b 0d 20 | 20 20 20 72 65 74 75 72 |ck(B);. | retur|
|000029d0| 6e 20 72 65 73 75 6c 74 | 3b 0d 75 6e 69 6f 6e 5f |n result|;.union_|
|000029e0| 61 62 6f 72 74 3a 0d 20 | 20 20 20 69 66 20 28 41 |abort:. | if (A|
|000029f0| 4d 61 70 20 21 3d 20 4e | 55 4c 4c 29 20 7b 20 44 |Map != N|ULL) { D|
|00002a00| 69 73 70 6f 73 65 48 61 | 6e 64 6c 65 28 28 48 61 |isposeHa|ndle((Ha|
|00002a10| 6e 64 6c 65 29 20 41 4d | 61 70 29 3b 20 48 55 6e |ndle) AM|ap); HUn|
|00002a20| 6c 6f 63 6b 28 41 29 3b | 20 7d 0d 20 20 20 20 69 |lock(A);| }. i|
|00002a30| 66 20 28 42 4d 61 70 20 | 21 3d 20 4e 55 4c 4c 29 |f (BMap |!= NULL)|
|00002a40| 20 7b 20 44 69 73 70 6f | 73 65 48 61 6e 64 6c 65 | { Dispo|seHandle|
|00002a50| 28 28 48 61 6e 64 6c 65 | 29 20 42 4d 61 70 29 3b |((Handle|) BMap);|
|00002a60| 20 48 55 6e 6c 6f 63 6b | 28 42 29 3b 20 7d 0d 20 | HUnlock|(B); }. |
|00002a70| 20 20 20 69 66 20 28 72 | 65 73 75 6c 74 20 21 3d | if (r|esult !=|
|00002a80| 20 4e 55 4c 4c 29 20 44 | 69 73 70 6f 73 65 48 61 | NULL) D|isposeHa|
|00002a90| 6e 64 6c 65 28 28 48 61 | 6e 64 6c 65 29 20 72 65 |ndle((Ha|ndle) re|
|00002aa0| 73 75 6c 74 29 3b 0d 20 | 20 20 20 72 65 74 75 72 |sult);. | retur|
|00002ab0| 6e 20 4e 55 4c 4c 3b 0d | 7d 0d 0d 48 61 6e 64 6c |n NULL;.|}..Handl|
|00002ac0| 65 20 53 74 72 69 6e 67 | 4c 69 73 74 49 6e 74 65 |e String|ListInte|
|00002ad0| 72 73 65 63 74 69 6f 6e | 28 48 61 6e 64 6c 65 20 |rsection|(Handle |
|00002ae0| 41 2c 20 48 61 6e 64 6c | 65 20 42 29 20 7b 0d 20 |A, Handl|e B) {. |
|00002af0| 20 20 20 53 74 72 69 6e | 67 50 74 72 20 2a 2a 41 | Strin|gPtr **A|
|00002b00| 4d 61 70 20 3d 20 4e 55 | 4c 4c 2c 20 2a 2a 42 4d |Map = NU|LL, **BM|
|00002b10| 61 70 20 3d 20 4e 55 4c | 4c 2c 20 73 74 72 61 2c |ap = NUL|L, stra,|
|00002b20| 20 73 74 72 62 3b 0d 20 | 20 20 20 48 61 6e 64 6c | strb;. | Handl|
|00002b30| 65 20 72 65 73 75 6c 74 | 20 3d 20 4e 55 4c 4c 3b |e result| = NULL;|
|00002b40| 0d 20 20 20 20 73 68 6f | 72 74 20 61 63 6f 75 6e |. sho|rt acoun|
|00002b50| 74 2c 20 62 63 6f 75 6e | 74 2c 20 69 2c 20 6a 2c |t, bcoun|t, i, j,|
|00002b60| 20 63 6d 70 3b 0d 20 20 | 20 20 69 66 20 28 28 72 | cmp;. | if ((r|
|00002b70| 65 73 75 6c 74 20 3d 20 | 4e 65 77 53 74 72 69 6e |esult = |NewStrin|
|00002b80| 67 4c 69 73 74 28 29 29 | 20 3d 3d 20 4e 55 4c 4c |gList())| == NULL|
|00002b90| 29 20 67 6f 74 6f 20 75 | 6e 69 6f 6e 5f 61 62 6f |) goto u|nion_abo|
|00002ba0| 72 74 3b 0d 20 20 20 20 | 69 66 20 28 28 41 4d 61 |rt;. |if ((AMa|
|00002bb0| 70 20 3d 20 4d 61 6b 65 | 53 6f 72 74 65 64 53 74 |p = Make|SortedSt|
|00002bc0| 72 69 6e 67 4c 69 73 74 | 4d 61 70 28 41 29 29 20 |ringList|Map(A)) |
|00002bd0| 3d 3d 20 4e 55 4c 4c 29 | 20 67 6f 74 6f 20 75 6e |== NULL)| goto un|
|00002be0| 69 6f 6e 5f 61 62 6f 72 | 74 3b 0d 20 20 20 20 69 |ion_abor|t;. i|
|00002bf0| 66 20 28 28 42 4d 61 70 | 20 3d 20 4d 61 6b 65 53 |f ((BMap| = MakeS|
|00002c00| 6f 72 74 65 64 53 74 72 | 69 6e 67 4c 69 73 74 4d |ortedStr|ingListM|
|00002c10| 61 70 28 42 29 29 20 3d | 3d 20 4e 55 4c 4c 29 20 |ap(B)) =|= NULL) |
|00002c20| 67 6f 74 6f 20 75 6e 69 | 6f 6e 5f 61 62 6f 72 74 |goto uni|on_abort|
|00002c30| 3b 0d 20 20 20 20 61 63 | 6f 75 6e 74 20 3d 20 53 |;. ac|ount = S|
|00002c40| 74 72 69 6e 67 4c 69 73 | 74 53 69 7a 65 28 41 29 |tringLis|tSize(A)|
|00002c50| 3b 0d 20 20 20 20 62 63 | 6f 75 6e 74 20 3d 20 53 |;. bc|ount = S|
|00002c60| 74 72 69 6e 67 4c 69 73 | 74 53 69 7a 65 28 42 29 |tringLis|tSize(B)|
|00002c70| 3b 0d 20 20 20 20 69 20 | 3d 20 6a 20 3d 20 30 3b |;. i |= j = 0;|
|00002c80| 0d 20 20 20 20 77 68 69 | 6c 65 20 28 69 20 3c 20 |. whi|le (i < |
|00002c90| 61 63 6f 75 6e 74 20 26 | 26 20 6a 20 3c 20 62 63 |acount &|& j < bc|
|00002ca0| 6f 75 6e 74 29 20 7b 0d | 20 20 20 20 20 20 20 20 |ount) {.| |
|00002cb0| 63 6d 70 20 3d 20 52 65 | 6c 53 74 72 69 6e 67 28 |cmp = Re|lString(|
|00002cc0| 28 73 74 72 61 20 3d 20 | 28 2a 41 4d 61 70 29 5b |(stra = |(*AMap)[|
|00002cd0| 69 5d 29 2c 20 28 73 74 | 72 62 20 3d 20 28 2a 42 |i]), (st|rb = (*B|
|00002ce0| 4d 61 70 29 5b 6a 5d 29 | 2c 0d 20 20 20 20 20 20 |Map)[j])|,. |
|00002cf0| 20 20 20 20 20 20 53 4c | 55 53 45 43 41 53 45 2c | SL|USECASE,|
|00002d00| 20 74 72 75 65 29 3b 0d | 20 20 20 20 20 20 20 20 | true);.| |
|00002d10| 69 66 20 28 63 6d 70 20 | 3d 3d 20 30 29 20 7b 0d |if (cmp |== 0) {.|
|00002d20| 20 20 20 20 20 20 20 20 | 20 20 20 20 53 74 72 69 | | Stri|
|00002d30| 6e 67 4c 69 73 74 41 70 | 70 65 6e 64 28 72 65 73 |ngListAp|pend(res|
|00002d40| 75 6c 74 2c 20 73 74 72 | 61 29 3b 0d 20 20 20 20 |ult, str|a);. |
|00002d50| 20 20 20 20 20 20 20 20 | 69 2b 2b 3b 20 6a 2b 2b | |i++; j++|
|00002d60| 3b 0d 20 20 20 20 20 20 | 20 20 7d 20 65 6c 73 65 |;. | } else|
|00002d70| 20 69 66 20 28 63 6d 70 | 20 3c 20 30 29 20 69 2b | if (cmp| < 0) i+|
|00002d80| 2b 3b 20 65 6c 73 65 20 | 6a 2b 2b 3b 0d 20 20 20 |+; else |j++;. |
|00002d90| 20 7d 0d 20 20 20 20 44 | 69 73 70 6f 73 65 48 61 | }. D|isposeHa|
|00002da0| 6e 64 6c 65 28 28 48 61 | 6e 64 6c 65 29 20 41 4d |ndle((Ha|ndle) AM|
|00002db0| 61 70 29 3b 20 48 55 6e | 6c 6f 63 6b 28 41 29 3b |ap); HUn|lock(A);|
|00002dc0| 0d 20 20 20 20 44 69 73 | 70 6f 73 65 48 61 6e 64 |. Dis|poseHand|
|00002dd0| 6c 65 28 28 48 61 6e 64 | 6c 65 29 20 42 4d 61 70 |le((Hand|le) BMap|
|00002de0| 29 3b 20 48 55 6e 6c 6f | 63 6b 28 42 29 3b 0d 20 |); HUnlo|ck(B);. |
|00002df0| 20 20 20 72 65 74 75 72 | 6e 20 72 65 73 75 6c 74 | retur|n result|
|00002e00| 3b 0d 75 6e 69 6f 6e 5f | 61 62 6f 72 74 3a 0d 20 |;.union_|abort:. |
|00002e10| 20 20 20 69 66 20 28 41 | 4d 61 70 20 21 3d 20 4e | if (A|Map != N|
|00002e20| 55 4c 4c 29 20 7b 20 44 | 69 73 70 6f 73 65 48 61 |ULL) { D|isposeHa|
|00002e30| 6e 64 6c 65 28 28 48 61 | 6e 64 6c 65 29 20 41 4d |ndle((Ha|ndle) AM|
|00002e40| 61 70 29 3b 20 48 55 6e | 6c 6f 63 6b 28 41 29 3b |ap); HUn|lock(A);|
|00002e50| 20 7d 0d 20 20 20 20 69 | 66 20 28 42 4d 61 70 20 | }. i|f (BMap |
|00002e60| 21 3d 20 4e 55 4c 4c 29 | 20 7b 20 44 69 73 70 6f |!= NULL)| { Dispo|
|00002e70| 73 65 48 61 6e 64 6c 65 | 28 28 48 61 6e 64 6c 65 |seHandle|((Handle|
|00002e80| 29 20 42 4d 61 70 29 3b | 20 48 55 6e 6c 6f 63 6b |) BMap);| HUnlock|
|00002e90| 28 42 29 3b 20 7d 0d 20 | 20 20 20 69 66 20 28 72 |(B); }. | if (r|
|00002ea0| 65 73 75 6c 74 20 21 3d | 20 4e 55 4c 4c 29 20 44 |esult !=| NULL) D|
|00002eb0| 69 73 70 6f 73 65 48 61 | 6e 64 6c 65 28 28 48 61 |isposeHa|ndle((Ha|
|00002ec0| 6e 64 6c 65 29 20 72 65 | 73 75 6c 74 29 3b 0d 20 |ndle) re|sult);. |
|00002ed0| 20 20 20 72 65 74 75 72 | 6e 20 4e 55 4c 4c 3b 0d | retur|n NULL;.|
|00002ee0| 7d 0d 0d 48 61 6e 64 6c | 65 20 53 74 72 69 6e 67 |}..Handl|e String|
|00002ef0| 4c 69 73 74 44 69 66 66 | 65 72 65 6e 63 65 28 48 |ListDiff|erence(H|
|00002f00| 61 6e 64 6c 65 20 41 2c | 20 48 61 6e 64 6c 65 20 |andle A,| Handle |
|00002f10| 42 29 20 7b 0d 20 20 20 | 20 53 74 72 69 6e 67 50 |B) {. | StringP|
|00002f20| 74 72 20 2a 2a 41 4d 61 | 70 20 3d 20 4e 55 4c 4c |tr **AMa|p = NULL|
|00002f30| 2c 20 2a 2a 42 4d 61 70 | 20 3d 20 4e 55 4c 4c 2c |, **BMap| = NULL,|
|00002f40| 20 73 74 72 61 2c 20 73 | 74 72 62 3b 0d 20 20 20 | stra, s|trb;. |
|00002f50| 20 48 61 6e 64 6c 65 20 | 72 65 73 75 6c 74 20 3d | Handle |result =|
|00002f60| 20 4e 55 4c 4c 3b 0d 20 | 20 20 20 73 68 6f 72 74 | NULL;. | short|
|00002f70| 20 61 63 6f 75 6e 74 2c | 20 62 63 6f 75 6e 74 2c | acount,| bcount,|
|00002f80| 20 69 2c 20 6a 2c 20 63 | 6d 70 3b 0d 20 20 20 20 | i, j, c|mp;. |
|00002f90| 69 66 20 28 28 72 65 73 | 75 6c 74 20 3d 20 4e 65 |if ((res|ult = Ne|
|00002fa0| 77 53 74 72 69 6e 67 4c | 69 73 74 28 29 29 20 3d |wStringL|ist()) =|
|00002fb0| 3d 20 4e 55 4c 4c 29 20 | 67 6f 74 6f 20 75 6e 69 |= NULL) |goto uni|
|00002fc0| 6f 6e 5f 61 62 6f 72 74 | 3b 0d 20 20 20 20 69 66 |on_abort|;. if|
|00002fd0| 20 28 28 41 4d 61 70 20 | 3d 20 4d 61 6b 65 53 6f | ((AMap |= MakeSo|
|00002fe0| 72 74 65 64 53 74 72 69 | 6e 67 4c 69 73 74 4d 61 |rtedStri|ngListMa|
|00002ff0| 70 28 41 29 29 20 3d 3d | 20 4e 55 4c 4c 29 20 67 |p(A)) ==| NULL) g|
|00003000| 6f 74 6f 20 75 6e 69 6f | 6e 5f 61 62 6f 72 74 3b |oto unio|n_abort;|
|00003010| 0d 20 20 20 20 69 66 20 | 28 28 42 4d 61 70 20 3d |. if |((BMap =|
|00003020| 20 4d 61 6b 65 53 6f 72 | 74 65 64 53 74 72 69 6e | MakeSor|tedStrin|
|00003030| 67 4c 69 73 74 4d 61 70 | 28 42 29 29 20 3d 3d 20 |gListMap|(B)) == |
|00003040| 4e 55 4c 4c 29 20 67 6f | 74 6f 20 75 6e 69 6f 6e |NULL) go|to union|
|00003050| 5f 61 62 6f 72 74 3b 0d | 20 20 20 20 61 63 6f 75 |_abort;.| acou|
|00003060| 6e 74 20 3d 20 53 74 72 | 69 6e 67 4c 69 73 74 53 |nt = Str|ingListS|
|00003070| 69 7a 65 28 41 29 3b 0d | 20 20 20 20 62 63 6f 75 |ize(A);.| bcou|
|00003080| 6e 74 20 3d 20 53 74 72 | 69 6e 67 4c 69 73 74 53 |nt = Str|ingListS|
|00003090| 69 7a 65 28 42 29 3b 0d | 20 20 20 20 69 20 3d 20 |ize(B);.| i = |
|000030a0| 6a 20 3d 20 30 3b 0d 20 | 20 20 20 77 68 69 6c 65 |j = 0;. | while|
|000030b0| 20 28 69 20 3c 20 61 63 | 6f 75 6e 74 20 26 26 20 | (i < ac|ount && |
|000030c0| 6a 20 3c 20 62 63 6f 75 | 6e 74 29 20 7b 0d 20 20 |j < bcou|nt) {. |
|000030d0| 20 20 20 20 20 20 63 6d | 70 20 3d 20 52 65 6c 53 | cm|p = RelS|
|000030e0| 74 72 69 6e 67 28 28 73 | 74 72 61 20 3d 20 28 2a |tring((s|tra = (*|
|000030f0| 41 4d 61 70 29 5b 69 5d | 29 2c 20 28 73 74 72 62 |AMap)[i]|), (strb|
|00003100| 20 3d 20 28 2a 42 4d 61 | 70 29 5b 6a 5d 29 2c 0d | = (*BMa|p)[j]),.|
|00003110| 20 20 20 20 20 20 20 20 | 20 20 20 20 53 4c 55 53 | | SLUS|
|00003120| 45 43 41 53 45 2c 20 74 | 72 75 65 29 3b 0d 20 20 |ECASE, t|rue);. |
|00003130| 20 20 20 20 20 20 69 66 | 20 28 63 6d 70 20 3d 3d | if| (cmp ==|
|00003140| 20 30 29 20 7b 0d 20 20 | 20 20 20 20 20 20 20 20 | 0) {. | |
|00003150| 20 20 69 2b 2b 3b 20 6a | 2b 2b 3b 0d 20 20 20 20 | i++; j|++;. |
|00003160| 20 20 20 20 7d 20 65 6c | 73 65 20 69 66 20 28 63 | } el|se if (c|
|00003170| 6d 70 20 3c 20 30 29 20 | 7b 0d 20 20 20 20 20 20 |mp < 0) |{. |
|00003180| 20 20 20 20 20 20 53 74 | 72 69 6e 67 4c 69 73 74 | St|ringList|
|00003190| 41 70 70 65 6e 64 28 72 | 65 73 75 6c 74 2c 20 73 |Append(r|esult, s|
|000031a0| 74 72 61 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |tra);. | |
|000031b0| 20 20 69 2b 2b 3b 0d 20 | 20 20 20 20 20 20 20 7d | i++;. | }|
|000031c0| 20 65 6c 73 65 20 7b 0d | 20 20 20 20 20 20 20 20 | else {.| |
|000031d0| 20 20 20 20 53 74 72 69 | 6e 67 4c 69 73 74 41 70 | Stri|ngListAp|
|000031e0| 70 65 6e 64 28 72 65 73 | 75 6c 74 2c 20 73 74 72 |pend(res|ult, str|
|000031f0| 62 29 3b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |b);. | |
|00003200| 6a 2b 2b 3b 0d 20 20 20 | 20 20 20 20 20 7d 0d 20 |j++;. | }. |
|00003210| 20 20 20 7d 0d 20 20 20 | 20 77 68 69 6c 65 20 28 | }. | while (|
|00003220| 69 20 3c 20 61 63 6f 75 | 6e 74 29 20 53 74 72 69 |i < acou|nt) Stri|
|00003230| 6e 67 4c 69 73 74 41 70 | 70 65 6e 64 28 72 65 73 |ngListAp|pend(res|
|00003240| 75 6c 74 2c 20 28 2a 41 | 4d 61 70 29 5b 69 2b 2b |ult, (*A|Map)[i++|
|00003250| 5d 29 3b 0d 20 20 20 20 | 77 68 69 6c 65 20 28 6a |]);. |while (j|
|00003260| 20 3c 20 62 63 6f 75 6e | 74 29 20 53 74 72 69 6e | < bcoun|t) Strin|
|00003270| 67 4c 69 73 74 41 70 70 | 65 6e 64 28 72 65 73 75 |gListApp|end(resu|
|00003280| 6c 74 2c 20 28 2a 42 4d | 61 70 29 5b 6a 2b 2b 5d |lt, (*BM|ap)[j++]|
|00003290| 29 3b 0d 20 20 20 20 44 | 69 73 70 6f 73 65 48 61 |);. D|isposeHa|
|000032a0| 6e 64 6c 65 28 28 48 61 | 6e 64 6c 65 29 20 41 4d |ndle((Ha|ndle) AM|
|000032b0| 61 70 29 3b 20 48 55 6e | 6c 6f 63 6b 28 41 29 3b |ap); HUn|lock(A);|
|000032c0| 0d 20 20 20 20 44 69 73 | 70 6f 73 65 48 61 6e 64 |. Dis|poseHand|
|000032d0| 6c 65 28 28 48 61 6e 64 | 6c 65 29 20 42 4d 61 70 |le((Hand|le) BMap|
|000032e0| 29 3b 20 48 55 6e 6c 6f | 63 6b 28 42 29 3b 0d 20 |); HUnlo|ck(B);. |
|000032f0| 20 20 20 72 65 74 75 72 | 6e 20 72 65 73 75 6c 74 | retur|n result|
|00003300| 3b 0d 75 6e 69 6f 6e 5f | 61 62 6f 72 74 3a 0d 20 |;.union_|abort:. |
|00003310| 20 20 20 69 66 20 28 41 | 4d 61 70 20 21 3d 20 4e | if (A|Map != N|
|00003320| 55 4c 4c 29 20 7b 20 44 | 69 73 70 6f 73 65 48 61 |ULL) { D|isposeHa|
|00003330| 6e 64 6c 65 28 28 48 61 | 6e 64 6c 65 29 20 41 4d |ndle((Ha|ndle) AM|
|00003340| 61 70 29 3b 20 48 55 6e | 6c 6f 63 6b 28 41 29 3b |ap); HUn|lock(A);|
|00003350| 20 7d 0d 20 20 20 20 69 | 66 20 28 42 4d 61 70 20 | }. i|f (BMap |
|00003360| 21 3d 20 4e 55 4c 4c 29 | 20 7b 20 44 69 73 70 6f |!= NULL)| { Dispo|
|00003370| 73 65 48 61 6e 64 6c 65 | 28 28 48 61 6e 64 6c 65 |seHandle|((Handle|
|00003380| 29 20 42 4d 61 70 29 3b | 20 48 55 6e 6c 6f 63 6b |) BMap);| HUnlock|
|00003390| 28 42 29 3b 20 7d 0d 20 | 20 20 20 69 66 20 28 72 |(B); }. | if (r|
|000033a0| 65 73 75 6c 74 20 21 3d | 20 4e 55 4c 4c 29 20 44 |esult !=| NULL) D|
|000033b0| 69 73 70 6f 73 65 48 61 | 6e 64 6c 65 28 28 48 61 |isposeHa|ndle((Ha|
|000033c0| 6e 64 6c 65 29 20 72 65 | 73 75 6c 74 29 3b 0d 20 |ndle) re|sult);. |
|000033d0| 20 20 20 72 65 74 75 72 | 6e 20 4e 55 4c 4c 3b 0d | retur|n NULL;.|
|000033e0| 7d 0d 0d 42 6f 6f 6c 65 | 61 6e 20 53 74 72 69 6e |}..Boole|an Strin|
|000033f0| 67 4c 69 73 74 53 75 62 | 73 65 74 28 48 61 6e 64 |gListSub|set(Hand|
|00003400| 6c 65 20 41 2c 20 48 61 | 6e 64 6c 65 20 42 29 20 |le A, Ha|ndle B) |
|00003410| 7b 0d 20 20 20 20 53 74 | 72 69 6e 67 50 74 72 20 |{. St|ringPtr |
|00003420| 2a 2a 41 4d 61 70 20 3d | 20 4e 55 4c 4c 2c 20 2a |**AMap =| NULL, *|
|00003430| 2a 42 4d 61 70 20 3d 20 | 4e 55 4c 4c 2c 20 73 74 |*BMap = |NULL, st|
|00003440| 72 61 2c 20 73 74 72 62 | 3b 0d 20 20 20 20 42 6f |ra, strb|;. Bo|
|00003450| 6f 6c 65 61 6e 20 72 65 | 73 75 6c 74 20 3d 20 74 |olean re|sult = t|
|00003460| 72 75 65 3b 0d 20 20 20 | 20 73 68 6f 72 74 20 61 |rue;. | short a|
|00003470| 63 6f 75 6e 74 2c 20 62 | 63 6f 75 6e 74 2c 20 69 |count, b|count, i|
|00003480| 2c 20 6a 2c 20 63 6d 70 | 3b 0d 20 20 20 20 69 66 |, j, cmp|;. if|
|00003490| 20 28 28 41 4d 61 70 20 | 3d 20 4d 61 6b 65 53 6f | ((AMap |= MakeSo|
|000034a0| 72 74 65 64 53 74 72 69 | 6e 67 4c 69 73 74 4d 61 |rtedStri|ngListMa|
|000034b0| 70 28 41 29 29 20 3d 3d | 20 4e 55 4c 4c 29 20 67 |p(A)) ==| NULL) g|
|000034c0| 6f 74 6f 20 75 6e 69 6f | 6e 5f 61 62 6f 72 74 3b |oto unio|n_abort;|
|000034d0| 0d 20 20 20 20 69 66 20 | 28 28 42 4d 61 70 20 3d |. if |((BMap =|
|000034e0| 20 4d 61 6b 65 53 6f 72 | 74 65 64 53 74 72 69 6e | MakeSor|tedStrin|
|000034f0| 67 4c 69 73 74 4d 61 70 | 28 42 29 29 20 3d 3d 20 |gListMap|(B)) == |
|00003500| 4e 55 4c 4c 29 20 67 6f | 74 6f 20 75 6e 69 6f 6e |NULL) go|to union|
|00003510| 5f 61 62 6f 72 74 3b 0d | 20 20 20 20 61 63 6f 75 |_abort;.| acou|
|00003520| 6e 74 20 3d 20 53 74 72 | 69 6e 67 4c 69 73 74 53 |nt = Str|ingListS|
|00003530| 69 7a 65 28 41 29 3b 0d | 20 20 20 20 62 63 6f 75 |ize(A);.| bcou|
|00003540| 6e 74 20 3d 20 53 74 72 | 69 6e 67 4c 69 73 74 53 |nt = Str|ingListS|
|00003550| 69 7a 65 28 42 29 3b 0d | 20 20 20 20 69 20 3d 20 |ize(B);.| i = |
|00003560| 6a 20 3d 20 30 3b 0d 20 | 20 20 20 77 68 69 6c 65 |j = 0;. | while|
|00003570| 20 28 69 20 3c 20 61 63 | 6f 75 6e 74 20 26 26 20 | (i < ac|ount && |
|00003580| 6a 20 3c 20 62 63 6f 75 | 6e 74 29 20 7b 0d 20 20 |j < bcou|nt) {. |
|00003590| 20 20 20 20 20 20 63 6d | 70 20 3d 20 52 65 6c 53 | cm|p = RelS|
|000035a0| 74 72 69 6e 67 28 28 73 | 74 72 61 20 3d 20 28 2a |tring((s|tra = (*|
|000035b0| 41 4d 61 70 29 5b 69 5d | 29 2c 20 28 73 74 72 62 |AMap)[i]|), (strb|
|000035c0| 20 3d 20 28 2a 42 4d 61 | 70 29 5b 6a 5d 29 2c 0d | = (*BMa|p)[j]),.|
|000035d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 53 4c 55 53 | | SLUS|
|000035e0| 45 43 41 53 45 2c 20 74 | 72 75 65 29 3b 0d 20 20 |ECASE, t|rue);. |
|000035f0| 20 20 20 20 20 20 69 66 | 20 28 63 6d 70 20 3d 3d | if| (cmp ==|
|00003600| 20 30 29 20 7b 20 20 20 | 20 2f 2f 20 69 6e 20 62 | 0) { | // in b|
|00003610| 6f 74 68 20 41 20 61 6e | 64 20 42 0d 20 20 20 20 |oth A an|d B. |
|00003620| 20 20 20 20 20 20 20 20 | 69 2b 2b 3b 20 6a 2b 2b | |i++; j++|
|00003630| 3b 0d 20 20 20 20 20 20 | 20 20 7d 20 65 6c 73 65 |;. | } else|
|00003640| 20 69 66 20 28 63 6d 70 | 20 3c 20 30 29 20 7b 20 | if (cmp| < 0) { |
|00003650| 20 20 20 2f 2f 20 69 6e | 20 41 20 62 75 74 20 6e | // in| A but n|
|00003660| 6f 74 20 69 6e 20 42 0d | 20 20 20 20 20 20 20 20 |ot in B.| |
|00003670| 20 20 20 20 69 2b 2b 3b | 0d 20 20 20 20 20 20 20 | i++;|. |
|00003680| 20 7d 20 65 6c 73 65 20 | 7b 20 20 20 20 2f 2f 20 | } else |{ // |
|00003690| 69 6e 20 42 20 62 75 74 | 20 6e 6f 74 20 69 6e 20 |in B but| not in |
|000036a0| 41 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 72 65 |A. | re|
|000036b0| 73 75 6c 74 20 3d 20 66 | 61 6c 73 65 3b 0d 20 20 |sult = f|alse;. |
|000036c0| 20 20 20 20 20 20 20 20 | 20 20 62 72 65 61 6b 3b | | break;|
|000036d0| 0d 20 20 20 20 20 20 20 | 20 7d 0d 20 20 20 20 7d |. | }. }|
|000036e0| 0d 20 20 20 20 44 69 73 | 70 6f 73 65 48 61 6e 64 |. Dis|poseHand|
|000036f0| 6c 65 28 28 48 61 6e 64 | 6c 65 29 20 41 4d 61 70 |le((Hand|le) AMap|
|00003700| 29 3b 20 48 55 6e 6c 6f | 63 6b 28 41 29 3b 0d 20 |); HUnlo|ck(A);. |
|00003710| 20 20 20 44 69 73 70 6f | 73 65 48 61 6e 64 6c 65 | Dispo|seHandle|
|00003720| 28 28 48 61 6e 64 6c 65 | 29 20 42 4d 61 70 29 3b |((Handle|) BMap);|
|00003730| 20 48 55 6e 6c 6f 63 6b | 28 42 29 3b 0d 20 20 20 | HUnlock|(B);. |
|00003740| 20 72 65 74 75 72 6e 20 | 72 65 73 75 6c 74 3b 0d | return |result;.|
|00003750| 75 6e 69 6f 6e 5f 61 62 | 6f 72 74 3a 0d 20 20 20 |union_ab|ort:. |
|00003760| 20 69 66 20 28 41 4d 61 | 70 20 21 3d 20 4e 55 4c | if (AMa|p != NUL|
|00003770| 4c 29 20 7b 20 44 69 73 | 70 6f 73 65 48 61 6e 64 |L) { Dis|poseHand|
|00003780| 6c 65 28 28 48 61 6e 64 | 6c 65 29 20 41 4d 61 70 |le((Hand|le) AMap|
|00003790| 29 3b 20 48 55 6e 6c 6f | 63 6b 28 41 29 3b 20 7d |); HUnlo|ck(A); }|
|000037a0| 0d 20 20 20 20 69 66 20 | 28 42 4d 61 70 20 21 3d |. if |(BMap !=|
|000037b0| 20 4e 55 4c 4c 29 20 7b | 20 44 69 73 70 6f 73 65 | NULL) {| Dispose|
|000037c0| 48 61 6e 64 6c 65 28 28 | 48 61 6e 64 6c 65 29 20 |Handle((|Handle) |
|000037d0| 42 4d 61 70 29 3b 20 48 | 55 6e 6c 6f 63 6b 28 42 |BMap); H|Unlock(B|
|000037e0| 29 3b 20 7d 0d 20 20 20 | 20 72 65 74 75 72 6e 20 |); }. | return |
|000037f0| 66 61 6c 73 65 3b 0d 7d | 0d 0d 42 6f 6f 6c 65 61 |false;.}|..Boolea|
|00003800| 6e 20 53 74 72 69 6e 67 | 4c 69 73 74 45 71 75 69 |n String|ListEqui|
|00003810| 76 61 6c 65 6e 74 28 48 | 61 6e 64 6c 65 20 41 2c |valent(H|andle A,|
|00003820| 20 48 61 6e 64 6c 65 20 | 42 29 20 7b 0d 20 20 20 | Handle |B) {. |
|00003830| 20 69 66 20 28 53 74 72 | 69 6e 67 4c 69 73 74 53 | if (Str|ingListS|
|00003840| 69 7a 65 28 41 29 20 3d | 3d 20 53 74 72 69 6e 67 |ize(A) =|= String|
|00003850| 4c 69 73 74 53 69 7a 65 | 28 42 29 20 26 26 20 53 |ListSize|(B) && S|
|00003860| 74 72 69 6e 67 4c 69 73 | 74 53 75 62 73 65 74 28 |tringLis|tSubset(|
|00003870| 41 2c 20 42 29 29 0d 20 | 20 20 20 20 20 20 20 72 |A, B)). | r|
|00003880| 65 74 75 72 6e 20 74 72 | 75 65 3b 0d 20 20 20 20 |eturn tr|ue;. |
|00003890| 65 6c 73 65 20 72 65 74 | 75 72 6e 20 66 61 6c 73 |else ret|urn fals|
|000038a0| 65 3b 0d 7d 0d 0d 2f 2a | 20 65 6e 64 20 6f 66 20 |e;.}../*| end of |
|000038b0| 66 69 6c 65 20 73 74 72 | 6c 69 73 74 2e 63 20 2a |file str|list.c *|
|000038c0| 2f 0d 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |/.......|........|
|000038d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000038e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000038f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003900| 00 00 01 00 00 00 01 6e | 00 00 00 6e 00 00 00 3e |.......n|...n...>|
|00003910| 01 38 01 ae 02 02 02 4e | 01 9c 02 1a 01 88 01 60 |.8.....N|.......`|
|00003920| 01 4a 01 78 01 cc 02 6e | 02 84 02 a0 02 bc 02 dc |.J.x...n|........|
|00003930| 09 73 74 72 6c 69 73 74 | 2e 63 02 00 00 00 54 45 |.strlist|.c....TE|
|00003940| 58 54 4d 50 53 20 01 00 | ff ff ff ff 00 00 00 00 |XTMPS ..|........|
|00003950| 00 00 54 45 58 54 4d 50 | 53 20 01 00 ff ff ff ff |..TEXTMP|S ......|
|00003960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003970| 00 00 ab 10 0e 3b 00 00 | 38 42 00 00 01 ac 00 00 |.....;..|8B......|
|00003980| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000039a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000039b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000039c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000039d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000039e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000039f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003a00| 00 00 00 48 00 0a 43 6f | 75 72 69 65 72 00 2e 68 |...H..Co|urier..h|
|00003a10| 03 df f9 70 6e 63 6c 75 | 64 65 20 3c 54 6f 6f 6c |...pnclu|de <Tool|
|00003a20| 55 74 69 6c 73 2e 00 06 | 00 04 00 48 00 1d 01 3d |Utils...|...H...=|
|00003a30| 01 c0 00 48 00 1d 01 3d | 01 c0 b0 5f 58 1b 00 00 |...H...=|..._X...|
|00003a40| 00 ff 00 00 02 da 00 00 | 01 fc 01 00 00 00 00 1e |........|........|
|00003a50| 00 48 00 1d 01 3d 01 c0 | 00 48 00 1d 01 3d 01 c0 |.H...=..|.H...=..|
|00003a60| 00 00 01 fc 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003a70| 01 00 00 00 01 6e 00 00 | 00 6e 00 00 00 3e 03 d6 |.....n..|.n...>..|
|00003a80| 71 38 26 32 00 00 00 1c | 00 3e 00 00 4d 50 53 52 |q8&2....|.>..MPSR|
|00003a90| 00 01 00 0a 03 ed ff ff | 00 00 00 00 00 00 00 00 |........|........|
|00003aa0| 03 f0 ff ff 00 00 00 4c | 03 d7 ca 20 00 00 00 00 |.......L|... ....|
|00003ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+